Skip to content

Commit 5a1e3ae

Browse files
committed
Add Sinon snippets
1 parent 0c7e7b6 commit 5a1e3ae

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,28 @@ function (err, req, res, next) {
636636
}
637637
```
638638

639+
### Sinon
640+
641+
#### `sbc⇥` sandbox.create
642+
```js
643+
sinon.sandbox.create();
644+
```
645+
646+
#### `sbr⇥` sandbox.restore
647+
```js
648+
sandbox.restore();
649+
```
650+
651+
#### `ac⇥` assert.called
652+
```js
653+
sinon.assert.called({1:spy});
654+
```
655+
656+
#### `acw⇥` assert.calledWith
657+
```js
658+
sinon.assert.calledWith({1:spy}, {2:args});
659+
```
660+
639661
### Miscellaneous
640662

641663
#### `us⇥` use strict

snippets/sinon.cson

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
".source.js, .source.ts, .source.tsx, .source.js-semantic":
2+
"sinon sandbox.create":
3+
prefix: "sbc"
4+
body: "sinon.sandbox.create();"
5+
"sinon sandbox.restore":
6+
prefix: "sbr"
7+
body: "sandbox.restore();"
8+
"sinon assert.called":
9+
prefix: "ac"
10+
body: "sinon.assert.called(${1:spy});"
11+
"sinon assert.calledWith":
12+
prefix: "acw"
13+
body: "sinon.assert.calledWith(${1:spy}, ${2:args});"

0 commit comments

Comments
 (0)