Installing Sinon

From Basef
Revision as of 10:07, 25 April 2018 by Admin (Talk | contribs) (Criou página com 'To install sinon in a Angular2+ project: <source lang="bash"> npm install --save-dev @types/sinon karma-sinon sinon </source> Open your '''karma.conf.js''' and add `sinon` t...')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

To install sinon in a Angular2+ project:

npm install --save-dev @types/sinon karma-sinon sinon

Open your karma.conf.js and add `sinon` to `frameworks` and `karma-sinon` to `plugins`:

module.exports = function (config) {
  config.set({
    ...
    frameworks: [
      ...
      'sinon', 
      ...
     ],
    ...
    plugins: [
      ...
      require('karma-sinon'),
      ...
    ],
    ...
  });
};