Installing Sinon

From Basef
Revision as of 09:38, 27 January 2020 by Admin (Talk | contribs)

(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'),
      ...
    ],
    ...
  });
};