This package provides additional TSLint rules that help to enforce some best practices when using Sinon mocking library.
-
sinon-prefer-resolves
- suggests to usestub.resolves(x)
instead ofstub.returns(Promise.resolve(x))
. -
sinon-prefer-sandbox
- suggests to create fakes viasandbox
instead of creating them directly.
- Run
npm install --save-dev tslint-sinon
- Add to your
tslint.json
:
"rules": {
"sinon-prefer-resolves": true,
"sinon-prefer-sandbox": true
},
"rulesDirectory": [
"tslint-sinon"
]