Skip to content

Commit 7d6962d

Browse files
add tests
1 parent 4945fb0 commit 7d6962d

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('production mode - failed', function () {
2+
it('test1', function () {});
3+
it('test2', function () { throw new Error('fail'); });
4+
it('test3', function () {});
5+
});
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
describe('production mode - only', function () {
22
it('test1', function () {});
3-
it.only('stest2', function () {});
3+
it.only('test2', function () {});
44
it('test3', function () {});
55
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('production mode - passed', function () {
2+
it('test1', function () {});
3+
it('test2', function () {});
4+
it('test3', function () {});
5+
});

test/integration/options.spec.js

+20-4
Original file line numberDiff line numberDiff line change
@@ -181,28 +181,44 @@ describe('options', function () {
181181
});
182182
});
183183

184-
describe('--production', function () {
184+
describe.only('--production', function () {
185185
before(function () {
186186
args = ['--production'];
187187
});
188188

189-
it('fails skipped tests', function (done) {
189+
it('succeeds if there are only passed tests', function (done) {
190+
run('options/production/passed.js', args, function (err, res) {
191+
assert(!err);
192+
assert.equal(res.code, 0);
193+
done();
194+
});
195+
});
196+
197+
it('fails if there are failed tests', function (done) {
198+
run('options/production/failed.js', args, function (err, res) {
199+
assert(!err);
200+
assert.equal(res.code, 1);
201+
done();
202+
});
203+
});
204+
205+
it('fails if there are skipped tests', function (done) {
190206
run('options/production/skipped.js', args, function (err, res) {
191207
assert(!err);
192208
assert.equal(res.code, 1);
193209
done();
194210
});
195211
});
196212

197-
it('fails pending tests', function (done) {
213+
it('fails if there are pending tests', function (done) {
198214
run('options/production/pending.js', args, function (err, res) {
199215
assert(!err);
200216
assert.equal(res.code, 1);
201217
done();
202218
});
203219
});
204220

205-
it('fails tests marked only', function (done) {
221+
it('fails if there are tests marked only', function (done) {
206222
run('options/production/only.js', args, function (err, res) {
207223
assert(!err);
208224
assert.equal(res.code, 1);

0 commit comments

Comments
 (0)