From 419d3ed9cfc994b4e6f33788399332493f337664 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Fri, 13 Apr 2018 13:13:45 -0700 Subject: [PATCH] convert test/unit/grep.spec.js to unexpected Signed-off-by: Christopher Hiller --- test/unit/grep.spec.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/unit/grep.spec.js b/test/unit/grep.spec.js index b25fbc901c..85968af71e 100644 --- a/test/unit/grep.spec.js +++ b/test/unit/grep.spec.js @@ -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\.\*/); }); }); @@ -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); }; } @@ -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); }); });