https://github.com/litee/tslint-sinon
TSLint rules for Sinon mocking library
https://github.com/litee/tslint-sinon
Last synced: 12 months ago
JSON representation
TSLint rules for Sinon mocking library
- Host: GitHub
- URL: https://github.com/litee/tslint-sinon
- Owner: Litee
- License: mit
- Created: 2019-01-27T13:25:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-15T03:57:29.000Z (over 4 years ago)
- Last Synced: 2025-06-12T18:31:54.327Z (12 months ago)
- Language: TypeScript
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tslint-sinon
UPDATE: Project is abandoned because TSLint is being replaced by ESLint + plugins.
This package provides additional TSLint rules that help to enforce some best practices when using Sinon mocking library.
## Supported rules
* `sinon-prefer-resolves` - suggests to use `stub.resolves(x)` instead of `stub.returns(Promise.resolve(x))`.
* `sinon-prefer-sandbox` - suggests to create fakes via `sandbox` instead of creating them directly.
## How to install
* Run `npm install --save-dev tslint-sinon`
* Add to your `tslint.json`:
```json
"rules": {
"sinon-prefer-resolves": true,
"sinon-prefer-sandbox": true
},
"rulesDirectory": [
"tslint-sinon"
]
```
## Status
[](https://travis-ci.org/Litee/tslint-sinon)