Installing Sinon

De Basef
Ir para: navegação, pesquisa

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