An open API service indexing awesome lists of open source software.

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

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

[![Build Status](https://travis-ci.org/Litee/tslint-sinon.png)](https://travis-ci.org/Litee/tslint-sinon)