forked from mochajs/mocha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grep.js
42 lines (35 loc) · 1.22 KB
/
grep.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var Mocha = require('../');
describe('Mocha', function(){
describe('"grep" option', function(){
it('should add a RegExp to the mocha.options object', function(){
var mocha = new Mocha({ grep: /foo/ });
mocha.options.grep.toString().should.equal('/foo/');
})
it('should convert grep string to a RegExp', function(){
var mocha = new Mocha({ grep: 'foo' });
mocha.options.grep.toString().should.equal('/foo/');
})
})
describe('.grep()', function(){
it('should add a RegExp to the mocha.options object', function(){
var mocha = new Mocha;
mocha.grep(/foo/);
mocha.options.grep.toString().should.equal('/foo/');
})
it('should convert grep string to a RegExp', function(){
var mocha = new Mocha;
mocha.grep('foo');
mocha.options.grep.toString().should.equal('/foo/');
})
it('should return it\'s parent Mocha object for chainability', function(){
var mocha = new Mocha;
mocha.grep().should.equal(mocha);
})
})
describe('"invert" option', function(){
it('should add a Boolean to the mocha.options object', function(){
var mocha = new Mocha({ invert: true });
mocha.options.invert.should.be.ok;
})
})
})