@capsulajs/capsulahub-service-test-ci
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Service Template extension

Service detailed info

Install

NPM

To install the package from NPM registry you should run

yarn add @capsulajs/capsulahub-service-template

or

npm install @capsulajs/capsulahub-service-template

CDN

You can get the default export from the link

https://capsulajs.s3.amazonaws.com/develop/service-template/index.js

WorkspaceConfiguration example

  "services": {
      "serviceName": "TestService",
      "path": "https://capsulajs.s3.amazonaws.com/develop/service-template/index.js",
      "definition": {
        "serviceName": "TestService",
        "methods": {
          "showMessage": { "asyncModel": "requestResponse" }
        }
      },
      "config": { "message": "Test message" }
  }

Exports

Default

Bootstrap function of the extension.

Named (API)

The public API of the extension.

API

CDN

The documentation about public API.

Local

Run

yarn doc

And open doc/index.html in browser.

Example

All of the manual debugging should be provided only in test:debug mode. Example folder is required only for Cypress needs.

Tests

Run

  1. yarn test
  2. yarn test:debug

Recommendations for testing

getServiceRef() checks that the service has been bootstrapped correctly and returns the instance of the service.

In order to create a stub or spy of any util a file with utils has to export an object, in which these utils are implemented. Then in the implementation of a test you can do:

import utils from '../../src/utils';
const getConfigStub = cy.stub(utils, getConfig);
getConfigStub.resolves({ name: 'configuration name' });

// run some code from functionality
expect(getConfigStub).to.be.called;

Expectations for stubs and spies:

https://docs.cypress.io/guides/references/assertions.html#Sinon-Chai

Licence

CapsulaHub and related services are released under MIT Licence.

Back to the Main Page

Readme

Keywords

none

Package Sidebar

Install

npm i @capsulajs/capsulahub-service-test-ci

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

9.04 kB

Total Files

23

Last publish

Collaborators

  • capsulajsbot
  • 95kach
  • mikesquall
  • capsulajsci
  • idanilt