Skip to content

Commit

Permalink
convert test/unit/grep.spec.js to unexpected
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
  • Loading branch information
boneskull committed Apr 21, 2018
1 parent 4837a6a commit 419d3ed
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/unit/grep.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ describe('Mocha', function () {
describe('"grep" option', function () {
it('should add a RegExp to the mocha.options object', function () {
var mocha = new Mocha({ grep: /foo.*/ });
expect(mocha.options.grep.toString()).to.equal('/foo.*/');
expect(mocha.options.grep, 'to equal', /foo.*/);
});

it('should convert string to a RegExp', function () {
var mocha = new Mocha({ grep: 'foo.*' });
expect(mocha.options.grep.toString()).to.equal('/foo.*/');
expect(mocha.options.grep, 'to equal', /foo.*/);
});
});

describe('"fgrep" option', function () {
it('should escape and convert string to a RegExp', function () {
var mocha = new Mocha({ fgrep: 'foo.*' });
expect(mocha.options.grep.toString()).to.equal('/foo\\.\\*/');
expect(mocha.options.grep, 'to equal', /foo\.\*/);
});
});

Expand All @@ -27,7 +27,7 @@ describe('Mocha', function () {
function testGrep (mocha) {
return function testGrep (grep, expected) {
mocha.grep(grep);
expect(mocha.options.grep.toString()).to.equal(expected);
expect(String(mocha.options.grep), 'to be', expected);
};
}

Expand All @@ -52,9 +52,9 @@ describe('Mocha', function () {
test('/^foo(.*)bar/g', '/^foo(.*)bar/g');
});

it('should return it\'s parent Mocha object for chainability', function () {
it('should return its parent Mocha object for chainability', function () {
var mocha = new Mocha();
expect(mocha.grep()).to.equal(mocha);
expect(mocha.grep(), 'to be', mocha);
});
});

Expand Down

0 comments on commit 419d3ed

Please sign in to comment.