Difference between revisions of "Installing Sinon"

From Basef
Jump to: navigation, search
(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...')
 
 
Line 28: Line 28:
 
</source>
 
</source>
  
[[Category: AngularJS2]]
+
[[Category: Angular]]

Latest revision as of 10:38, 27 January 2020

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