Skip to content

Commit 89ed58a

Browse files
committed
Use sinon-chai for extra readability
1 parent 5c539fe commit 89ed58a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"postcss-property-lookup": "^1.1.4",
4040
"rewire": "^2.5.1",
4141
"sinon": "^1.17.2",
42+
"sinon-chai": "^2.8.0",
4243
"stylelint-config-suitcss": "^1.0.0"
4344
},
4445
"scripts": {

test/test.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
var expect = require('chai').expect;
1+
var chai = require('chai');
22
var sinon = require('sinon');
33
var child = require('child_process');
44
var exec = child.exec;
55
var fs = require('fs');
66
var rewire = require('rewire');
77
var suitcss = rewire('../lib');
88
var path = require('path');
9+
var sinonChai = require('sinon-chai');
10+
11+
chai.use(sinonChai);
12+
var expect = chai.expect;
913

1014
/**
1115
* Node API tests.
@@ -182,9 +186,9 @@ describe('suitcss', function() {
182186
beforeLint: beforeLintStub
183187
}).catch(done);
184188

185-
expect(lintImportedFilesStub.calledOnce).to.be.true;
186-
expect(beforeLintStub.calledOnce).to.be.true;
187-
expect(beforeLintStub.calledBefore(lintImportedFilesStub)).to.be.true;
189+
expect(lintImportedFilesStub).to.be.called.once;
190+
expect(beforeLintStub).to.be.called.once;
191+
expect(beforeLintStub).to.have.been.calledBefore(lintImportedFilesStub);
188192

189193
done();
190194
});

0 commit comments

Comments
 (0)