karma-vca-api

A Karma plugin middleware that implements the VCA APIs

Usage no npm install needed!

<script type="module">
  import karmaVcaApi from 'https://cdn.skypack.dev/karma-vca-api';
</script>

README

karma-vca-api NPM version NPM downloads NPM license

A Karma plugin middleware that implements the VCA APIs

Installation

$ npm install --save-dev karma-vca-api

Usage

/* karma.conf.js */
module.exports = function(config) {
  config.set({
    /* Use the middleware */
    middleware: ['vca-api'],

    /* Passed to the Api constructor */
    vcaApi: {
      endpoint: '/test'
    }
  });
}

Resetting Between Tests

To provide a consistent testing environment it is useful for the API to be reset between tests. There are framework adaptors for popular testing frameworks that perform a POST request with the browsers Karma identification number to /karma-vca-api/api/reset so that the middleware data storage gets reset.

License

MIT © VCA Technology