0.0.3 • Published 4 years ago

@capsulajs/capsulahub-service-renderer v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Service Renderer

Service extension, that renders all the web-components, that are registered in Workspace.

Install

NPM

To install the package from NPM registry you should run

yarn add @capsulajs/capsulahub-service-renderer

or

npm install @capsulajs/capsulahub-service-renderer

CDN

You can get the default export from the link

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

WorkspaceConfiguration example

  "services": {
      "serviceName": "RendererService",
      "path": "https://capsulajs.s3.amazonaws.com/develop/service-renderer/index.js",
      "definition": {
        "serviceName": "RendererService",
        "methods": {
          "renderLayouts": { "asyncModel": "requestResponse" },
          "renderItems": { "asyncModel": "requestResponse" },
          "renderItem": { "asyncModel": "requestResponse" },
        }
      },
      "config": {}
  }

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

0.0.2-next.35

4 years ago

0.0.3

4 years ago

0.0.2-next.32

4 years ago

0.0.2-next.14

5 years ago

0.0.2-next.11

5 years ago

0.0.2-next.9

5 years ago

0.0.2-next.7

5 years ago

0.0.2-next.6

5 years ago

0.0.2-next.2

5 years ago

0.0.2-next.1

5 years ago

0.0.2-alpha.3

5 years ago

0.0.2-alpha.2

5 years ago

0.0.2-alpha.1

5 years ago

0.0.2-alpha.0

5 years ago

0.0.1

5 years ago