diff --git a/test/ExternalModule.unittest.js b/test/ExternalModule.unittest.js index a193d9842..7f5706f0b 100644 --- a/test/ExternalModule.unittest.js +++ b/test/ExternalModule.unittest.js @@ -60,7 +60,7 @@ describe("ExternalModule", () => { expect(externalModule.getSource.callCount).toBe(1); expect(externalModule.getSourceString.callCount).toBe(1); expect(externalModule.getSource.args[0][0]).toBe(expectedString); - expect(result).toBe(expectedSource); + expect(result).toEqual(expectedSource); }); }); @@ -77,7 +77,7 @@ describe("ExternalModule", () => { const result = externalModule.getSource(someSourceString); // check - expect(result).toBeInstanceOf(OriginalSource); + expect(result).toEqualInstanceOf(OriginalSource); }); }); describe("given it does not use source maps", () => { @@ -92,7 +92,7 @@ describe("ExternalModule", () => { const result = externalModule.getSource(someSourceString); // check - expect(result).toBeInstanceOf(RawSource); + expect(result).toEqualInstanceOf(RawSource); }); }); }); @@ -109,7 +109,7 @@ describe("ExternalModule", () => { const result = externalModule.getSourceForGlobalVariableExternal(varName, type); // check - expect(result).toBe(expected); + expect(result).toEqual(expected); }); }); describe("given an single variable name", () => { @@ -123,7 +123,7 @@ describe("ExternalModule", () => { const result = externalModule.getSourceForGlobalVariableExternal(varName, type); // check - expect(result).toBe(expected); + expect(result).toEqual(expected); }); }); }); @@ -139,7 +139,7 @@ describe("ExternalModule", () => { const result = externalModule.getSourceForCommonJsExternal(varName, type); // check - expect(result).toBe(expected); + expect(result).toEqual(expected); }); }); describe("given an single variable name", () => { @@ -153,7 +153,7 @@ describe("ExternalModule", () => { const result = externalModule.getSourceForCommonJsExternal(varName, type); // check - expect(result).toBe(expected); + expect(result).toEqual(expected); }); }); }); @@ -170,7 +170,7 @@ describe("ExternalModule", () => { const result = externalModule.checkExternalVariable(variableToCheck, request); // check - expect(result).toBe(expected); + expect(result).toEqual(expected); }); }); @@ -185,7 +185,7 @@ describe("ExternalModule", () => { const result = externalModule.getSourceForAmdOrUmdExternal(id, optional, request); // check - expect(result).toBe(expected); + expect(result).toEqual(expected); }); describe("given an optinal check is set", () => { it("ads a check for the existance of the variable before looking it up", () => { @@ -199,7 +199,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_someId__;`; const result = externalModule.getSourceForAmdOrUmdExternal(id, optional, request); // check - expect(result).toBe(expected); + expect(result).toEqual(expected); }); }); }); @@ -214,7 +214,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_someId__;`; const result = externalModule.getSourceForDefaultCase(optional, request); // check - expect(result).toBe(expected); + expect(result).toEqual(expected); }); describe("given an optinal check is requested", () => { it("checks for the existance of the request setting it", () => { @@ -227,7 +227,7 @@ module.exports = some/request;`; const result = externalModule.getSourceForDefaultCase(optional, request); // check - expect(result).toBe(expected); + expect(result).toEqual(expected); }); }); }); diff --git a/test/MultiStats.unittest.js b/test/MultiStats.unittest.js index d802f5f4b..121c77d2a 100644 --- a/test/MultiStats.unittest.js +++ b/test/MultiStats.unittest.js @@ -263,7 +263,7 @@ describe("MultiStats", () => { }); it("returns string representation", () => { - expect(result).toBe( + expect(result).toEqual( "Hash: abc123xyz890\n" + "Version: webpack 1.2.3\n" + "Child abc123-compilation:\n" + diff --git a/test/cases/amd/namedModules/index.js b/test/cases/amd/namedModules/index.js index 51313a514..0084e7348 100644 --- a/test/cases/amd/namedModules/index.js +++ b/test/cases/amd/namedModules/index.js @@ -16,14 +16,14 @@ define("named4", [], function() { define(["named1", "named2"], function(named1, named2) { it("should load the named modules in defined dependencies", function() { - named1.should.be.eql("named1"); - named2.should.be.eql("named2"); + expect(named1).toBe("named1"); + expect(named2).toBe("named2"); }); it("should load the named modules in require dependencies", function(done) { require(["named3", "named4"], function (named3, named4) { - named3.should.be.eql("named3"); - named4.should.be.eql("named4"); + expect(named3).toBe("named3"); + expect(named4).toBe("named4"); done(); }); }); diff --git a/test/cases/amd/namedModulesConstArrayDep/index.js b/test/cases/amd/namedModulesConstArrayDep/index.js index e6dc0eb10..e8b0995cd 100644 --- a/test/cases/amd/namedModulesConstArrayDep/index.js +++ b/test/cases/amd/namedModulesConstArrayDep/index.js @@ -16,14 +16,14 @@ define("named4", [], function() { define("named1,named2".split(","), function(named1, named2) { it("should load the named modules in const array defined dependencies", function() { - named1.should.be.eql("named1"); - named2.should.be.eql("named2"); + expect(named1).toBe("named1"); + expect(named2).toBe("named2"); }); it("should load the named modules in const array require dependencies", function(done) { require("named3,named4".split(","), function (named3, named4) { - named3.should.be.eql("named3"); - named4.should.be.eql("named4"); + expect(named3).toBe("named3"); + expect(named4).toBe("named4"); done(); }); }); diff --git a/test/cases/chunks/circular-correctness/index.js b/test/cases/chunks/circular-correctness/index.js index 5db11228d..e9878a8d5 100644 --- a/test/cases/chunks/circular-correctness/index.js +++ b/test/cases/chunks/circular-correctness/index.js @@ -2,7 +2,7 @@ it("should handle circular chunks correctly", function(done) { import(/* webpackChunkName: "a" */"./module-a").then(function(result) { return result.default(); }).then(function(result2) { - result2.default().should.be.eql("x"); + expect(result2.default()).toBe("x"); done(); }).catch(function(e) { done(e); diff --git a/test/cases/chunks/context-weak/index.js b/test/cases/chunks/context-weak/index.js index dbcdef64c..192a7c830 100644 --- a/test/cases/chunks/context-weak/index.js +++ b/test/cases/chunks/context-weak/index.js @@ -7,12 +7,12 @@ it("should not bundle context requires with asyncMode === 'weak'", function() { it("should find module with asyncMode === 'weak' when required elsewhere", function() { var contextRequire = require.context(".", false, /.+/, "weak"); - contextRequire("./three").should.be.eql(3); + expect(contextRequire("./three")).toBe(3); require("./three"); // in a real app would be served as a separate chunk }); it("should find module with asyncMode === 'weak' when required elsewhere (recursive)", function() { var contextRequire = require.context(".", true, /.+/, "weak"); - contextRequire("./dir/four").should.be.eql(4); + expect(contextRequire("./dir/four")).toBe(4); require("./dir/four"); // in a real app would be served as a separate chunk }); diff --git a/test/cases/chunks/context/index.js b/test/cases/chunks/context/index.js index 37a6e7ac1..7658b1a0e 100644 --- a/test/cases/chunks/context/index.js +++ b/test/cases/chunks/context/index.js @@ -1,9 +1,9 @@ it("should also work in a chunk", function(done) { require.ensure([], function(require) { var contextRequire = require.context(".", false, /two/); - contextRequire("./two").should.be.eql(2); + expect(contextRequire("./two")).toBe(2); var tw = "tw"; - require("." + "/" + tw + "o").should.be.eql(2); + expect(require("." + "/" + tw + "o")).toBe(2); done(); }); }); diff --git a/test/cases/chunks/import-context/index.js b/test/cases/chunks/import-context/index.js index ae1da48a9..b6feb3586 100644 --- a/test/cases/chunks/import-context/index.js +++ b/test/cases/chunks/import-context/index.js @@ -2,11 +2,11 @@ function testCase(load, done) { load("two", 2, function() { var sync = true; load("one", 1, function() { - sync.should.be.eql(false); + expect(sync).toBe(false); load("three", 3, function() { var sync = true; load("two", 2, function() { - sync.should.be.eql(true); + expect(sync).toBe(true); done(); }); Promise.resolve().then(function() {}).then(function() {}).then(function() { @@ -23,7 +23,7 @@ function testCase(load, done) { it("should be able to use expressions in import", function(done) { function load(name, expected, callback) { import("./dir/" + name).then(function(result) { - result.should.be.eql({ default: expected }); + expect(result).toEqual({ default: expected }); callback(); }).catch(function(err) { done(err); diff --git a/test/cases/chunks/import/index.js b/test/cases/chunks/import/index.js index 8dd0f33ba..cf1293edd 100644 --- a/test/cases/chunks/import/index.js +++ b/test/cases/chunks/import/index.js @@ -1,6 +1,6 @@ it("should be able to use import", function(done) { import("./two").then(function(two) { - two.should.be.eql({ default: 2 }); + expect(two).toEqual({ default: 2 }); done(); }).catch(function(err) { done(err); diff --git a/test/cases/chunks/inline-options/index.js b/test/cases/chunks/inline-options/index.js index f5249e659..09e5bf89f 100644 --- a/test/cases/chunks/inline-options/index.js +++ b/test/cases/chunks/inline-options/index.js @@ -106,16 +106,16 @@ function testChunkLoading(load, expectedSyncInitial, expectedSyncRequested) { var sync = false; var syncInitial = true; var p = Promise.all([load("a"), load("b")]).then(function() { - syncInitial.should.be.eql(expectedSyncInitial); + expect(syncInitial).toBe(expectedSyncInitial); sync = true; var p = Promise.all([ load("a").then(function(a) { - a.should.be.eql({ default: "a" }); - sync.should.be.eql(true); + expect(a).toEqual({ default: "a" }); + expect(sync).toBe(true); }), load("c").then(function(c) { - c.should.be.eql({ default: "c" }); - sync.should.be.eql(expectedSyncRequested); + expect(c).toEqual({ default: "c" }); + expect(sync).toBe(expectedSyncRequested); }) ]); Promise.resolve().then(function(){}).then(function(){}).then(function(){}).then(function(){ diff --git a/test/cases/chunks/issue-2443/index.js b/test/cases/chunks/issue-2443/index.js index 299e99d7f..a70e5e03e 100644 --- a/test/cases/chunks/issue-2443/index.js +++ b/test/cases/chunks/issue-2443/index.js @@ -1,7 +1,7 @@ it("should be able to use expressions in import (directory)", function(done) { function load(name, expected, callback) { import("./dir/" + name + "/file.js").then(function(result) { - result.should.be.eql({ default: expected }); + expect(result).toEqual({ default: expected }); callback(); }).catch(function(err) { done(err); diff --git a/test/cases/chunks/parsing/index.js b/test/cases/chunks/parsing/index.js index edefaf296..474fcfc60 100644 --- a/test/cases/chunks/parsing/index.js +++ b/test/cases/chunks/parsing/index.js @@ -2,11 +2,11 @@ var should = require("should"); it("should handle bound function expressions", function(done) { require.ensure([], function(require) { - this.should.be.eql({ test: true }); + expect(this).toEqual({ test: true }); require("./empty?test"); process.nextTick.should.have.type("function"); // check if injection still works require.ensure([], function(require) { - this.should.be.eql({ test: true }); + expect(this).toEqual({ test: true }); done(); }.bind(this)); }.bind({test: true})); @@ -21,7 +21,7 @@ it("should handle require.ensure without function expression", function(done) { it("should parse expression in require.ensure, which isn't a function expression", function(done) { require.ensure([], (function() { - require("./empty?require.ensure:test").should.be.eql({}); + expect(require("./empty?require.ensure:test")).toEqual({}); return function f() { done(); }; @@ -36,7 +36,7 @@ it("should accept a require.include call", function(done) { }); setImmediate(function() { should.strictEqual(value, "require.include"); - value.should.be.eql("require.include"); + expect(value).toBe("require.include"); done(); }); }); diff --git a/test/cases/chunks/runtime/duplicate.js b/test/cases/chunks/runtime/duplicate.js index 9867c8106..354829318 100644 --- a/test/cases/chunks/runtime/duplicate.js +++ b/test/cases/chunks/runtime/duplicate.js @@ -1,3 +1,3 @@ require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); -}) \ No newline at end of file + expect(require("./a")).toBe("a"); +}) diff --git a/test/cases/chunks/runtime/duplicate2.js b/test/cases/chunks/runtime/duplicate2.js index e6ab3c768..37b0f6b4d 100644 --- a/test/cases/chunks/runtime/duplicate2.js +++ b/test/cases/chunks/runtime/duplicate2.js @@ -1,3 +1,3 @@ require.ensure(["./b"], function(require) { - require("./b").should.be.eql("a"); -}) \ No newline at end of file + expect(require("./b")).toBe("a"); +}) diff --git a/test/cases/chunks/runtime/index.js b/test/cases/chunks/runtime/index.js index 30b8e1dfa..a07031653 100644 --- a/test/cases/chunks/runtime/index.js +++ b/test/cases/chunks/runtime/index.js @@ -21,7 +21,7 @@ it("should not load a chunk which is included in a already loaded one", function var asyncFlag = false; require.ensure(["./empty?x", "./empty?y", "./empty?z"], function(require) { try { - asyncFlag.should.be.eql(true); + expect(asyncFlag).toBe(true); loadChunk(); } catch(e) { done(e); @@ -34,7 +34,7 @@ it("should not load a chunk which is included in a already loaded one", function var sync = true; require.ensure(["./empty?x", "./empty?y"], function(require) { try { - sync.should.be.eql(true); + expect(sync).toBe(true); done(); } catch(e) { done(e); diff --git a/test/cases/chunks/weak-dependencies-context/index.js b/test/cases/chunks/weak-dependencies-context/index.js index 96477ab2f..76ebfcc5d 100644 --- a/test/cases/chunks/weak-dependencies-context/index.js +++ b/test/cases/chunks/weak-dependencies-context/index.js @@ -18,7 +18,7 @@ it("should not include a module with a weak dependency using context", function( resolveWeakB.should.exist; resolveWeakC.should.exist; - a.should.be.eql(false); - b.should.be.eql(false); - c.should.be.eql(true); + expect(a).toBe(false); + expect(b).toBe(false); + expect(c).toBe(true); }); diff --git a/test/cases/chunks/weak-dependencies/index.js b/test/cases/chunks/weak-dependencies/index.js index bde0c7db0..d293d17f5 100644 --- a/test/cases/chunks/weak-dependencies/index.js +++ b/test/cases/chunks/weak-dependencies/index.js @@ -5,9 +5,9 @@ it("should not include a module with a weak dependency", function() { var d = !!__webpack_modules__[require.resolveWeak("./d")]; require(["./c"]); require("./d"); - - a.should.be.eql(false); - b.should.be.eql(true); - c.should.be.eql(false); - d.should.be.eql(true); -}); \ No newline at end of file + + expect(a).toBe(false); + expect(b).toBe(true); + expect(c).toBe(false); + expect(d).toBe(true); +}); diff --git a/test/cases/chunks/weird-reference-to-entry/index.js b/test/cases/chunks/weird-reference-to-entry/index.js index ea307b7e9..d22953e46 100644 --- a/test/cases/chunks/weird-reference-to-entry/index.js +++ b/test/cases/chunks/weird-reference-to-entry/index.js @@ -1,6 +1,6 @@ it("should handle reference to entry chunk correctly", function(done) { import(/* webpackChunkName: "main" */"./module-a").then(function(result) { - result.default.should.be.eql("ok"); + expect(result.default).toBe("ok"); done(); }).catch(function(e) { done(e); diff --git a/test/cases/compile/deduplication-bundle-loader/index.js b/test/cases/compile/deduplication-bundle-loader/index.js index e713c6063..7b5adeae0 100644 --- a/test/cases/compile/deduplication-bundle-loader/index.js +++ b/test/cases/compile/deduplication-bundle-loader/index.js @@ -1,12 +1,12 @@ it("should load a duplicate module with different dependencies correctly", function(done) { var a = require("bundle-loader!./a/file"); var b = require("bundle-loader!./b/file"); - (typeof a).should.be.eql("function"); - (typeof b).should.be.eql("function"); + expect((typeof a)).toBe("function"); + expect((typeof b)).toBe("function"); a(function(ra) { - ra.should.be.eql("a"); + expect(ra).toBe("a"); b(function(rb) { - rb.should.be.eql("b"); + expect(rb).toBe("b"); done(); }) }); diff --git a/test/cases/compile/deduplication/index.js b/test/cases/compile/deduplication/index.js index dfe4dba1c..df4bdbee7 100644 --- a/test/cases/compile/deduplication/index.js +++ b/test/cases/compile/deduplication/index.js @@ -1,6 +1,6 @@ it("should load a duplicate module with different dependencies correctly", function() { var dedupe1 = require("./dedupe1"); var dedupe2 = require("./dedupe2"); - dedupe1.should.be.eql("dedupe1"); - dedupe2.should.be.eql("dedupe2"); + expect(dedupe1).toBe("dedupe1"); + expect(dedupe2).toBe("dedupe2"); }); diff --git a/test/cases/concord/inner-modules-and-extensions/index.js b/test/cases/concord/inner-modules-and-extensions/index.js index b35fdaacb..4a2f7000f 100644 --- a/test/cases/concord/inner-modules-and-extensions/index.js +++ b/test/cases/concord/inner-modules-and-extensions/index.js @@ -1,12 +1,12 @@ it("should resolve the alias in package.json", function() { - require("app/file").default.should.be.eql("file"); + expect(require("app/file").default).toBe("file"); }); it("should resolve the alias and extensions in package.json", function() { - require("app/file2").default.should.be.eql("correct file2"); + expect(require("app/file2").default).toBe("correct file2"); }); it("should resolve the alias in package.json", function() { - require("thing").default.should.be.eql("the thing"); + expect(require("thing").default).toBe("the thing"); }); diff --git a/test/cases/context/issue-3873/index.js b/test/cases/context/issue-3873/index.js index 8135a5a73..01f49fbd7 100644 --- a/test/cases/context/issue-3873/index.js +++ b/test/cases/context/issue-3873/index.js @@ -3,5 +3,5 @@ function get(name) { } it("should automatically infer the index.js file", function() { - get("module").should.be.eql("module"); + expect(get("module")).toBe("module"); }); diff --git a/test/cases/context/issue-524/index.js b/test/cases/context/issue-524/index.js index 8c42102a7..1084ade6c 100644 --- a/test/cases/context/issue-524/index.js +++ b/test/cases/context/issue-524/index.js @@ -7,7 +7,7 @@ it("should support an empty context", function() { (function() { c(""); }).should.throw(); - c.keys().should.be.eql([]); + expect(c.keys()).toEqual([]); }); // This would be a useful testcase, but it requires an (really) empty directory. @@ -21,5 +21,5 @@ it("should support an empty context", function() { (function() { c(""); }).should.throw(); - c.keys().should.be.eql([]); + expect(c.keys()).toEqual([]); });*/ diff --git a/test/cases/context/issue-5750/index.js b/test/cases/context/issue-5750/index.js index 09b525ab0..92b55ac84 100644 --- a/test/cases/context/issue-5750/index.js +++ b/test/cases/context/issue-5750/index.js @@ -1,4 +1,4 @@ it("should not use regexps with the g flag", function() { - require.context("./folder", true, /a/).keys().length.should.be.eql(1); - require.context("./folder", true, /a/g).keys().length.should.be.eql(0); + expect(require.context("./folder", true, /a/).keys().length).toBe(1); + expect(require.context("./folder", true, /a/g).keys().length).toBe(0); }); diff --git a/test/cases/context/issue-801/index.js b/test/cases/context/issue-801/index.js index bacd8cc43..c96532006 100644 --- a/test/cases/context/issue-801/index.js +++ b/test/cases/context/issue-801/index.js @@ -1,7 +1,7 @@ it("should emit valid code for dynamic require string with expr", function() { var test = require("./folder/file"); - test("file").should.be.eql({ a: false, b: false, c: true, d: true }); - test("file.js").should.be.eql({ a: false, b: false, c: false, d: true }); - test("./file").should.be.eql({ a: true, b: true, c: false, d: false }); - test("./file.js").should.be.eql({ a: false, b: false, c: false, d: false }); -}); \ No newline at end of file + expect(test("file")).toEqual({ a: false, b: false, c: true, d: true }); + expect(test("file.js")).toEqual({ a: false, b: false, c: false, d: true }); + expect(test("./file")).toEqual({ a: true, b: true, c: false, d: false }); + expect(test("./file.js")).toEqual({ a: false, b: false, c: false, d: false }); +}); diff --git a/test/cases/json/data/index.js b/test/cases/json/data/index.js index b4e30016b..e90a26418 100644 --- a/test/cases/json/data/index.js +++ b/test/cases/json/data/index.js @@ -1,8 +1,8 @@ it("should require json via require", function() { - ({ data: require("./a.json") }).should.be.eql({ data: null }); - ({ data: require("./b.json") }).should.be.eql({ data: 123 }); - ({ data: require("./c.json") }).should.be.eql({ data: [1, 2, 3, 4] }); - ({ data: require("./e.json") }).should.be.eql({ data: { + ({ data: require("./a.json") }expect()).toEqual({ data: null }); + ({ data: require("./b.json") }expect()).toEqual({ data: 123 }); + ({ data: require("./c.json") }expect()).toEqual({ data: [1, 2, 3, 4] }); + ({ data: require("./e.json") }expect()).toEqual({ data: { "aa": 1, "bb": 2, "1": "x" diff --git a/test/cases/json/import-by-name/index.js b/test/cases/json/import-by-name/index.js index 589170057..616c028b0 100644 --- a/test/cases/json/import-by-name/index.js +++ b/test/cases/json/import-by-name/index.js @@ -5,12 +5,12 @@ import f, { named } from "../data/f.json"; import g, { named as gnamed } from "../data/g.json"; it("should be possible to import json data", function() { - c[2].should.be.eql(3); - Object.keys(d).should.be.eql(["default"]); - aa.should.be.eql(1); - bb.should.be.eql(2); - named.should.be.eql("named"); - ({ f }).should.be.eql({ + expect(c[2]).toBe(3); + expect(Object.keys(d)).toEqual(["default"]); + expect(aa).toBe(1); + expect(bb).toBe(2); + expect(named).toBe("named"); + ({ f }expect()).toEqual({ f: { __esModule: true, default: "default", diff --git a/test/cases/json/import-with-default/index.js b/test/cases/json/import-with-default/index.js index e138d294e..b30c71d51 100644 --- a/test/cases/json/import-with-default/index.js +++ b/test/cases/json/import-with-default/index.js @@ -6,16 +6,16 @@ import e from "../data/e.json"; import f from "../data/f.json"; it("should be possible to import json data", function() { - ({a}).should.be.eql({a: null}); - b.should.be.eql(123); - c.should.be.eql([1, 2, 3, 4]); - d.should.be.eql({}); - e.should.be.eql({ + ({a}expect()).toEqual({a: null}); + expect(b).toBe(123); + expect(c).toEqual([1, 2, 3, 4]); + expect(d).toEqual({}); + expect(e).toEqual({ aa: 1, bb: 2, "1": "x" }); - f.should.be.eql({ + expect(f).toEqual({ named: "named", "default": "default", __esModule: true diff --git a/test/cases/loaders/async/index.js b/test/cases/loaders/async/index.js index 0c3a7cb0f..8d7a8628b 100644 --- a/test/cases/loaders/async/index.js +++ b/test/cases/loaders/async/index.js @@ -1,14 +1,14 @@ it("should allow combinations of async and sync loaders", function() { - require("./loaders/syncloader!./a").should.be.eql("a"); - require("./loaders/asyncloader!./a").should.be.eql("a"); + expect(require("./loaders/syncloader!./a")).toBe("a"); + expect(require("./loaders/asyncloader!./a")).toBe("a"); - require("./loaders/syncloader!./loaders/syncloader!./a").should.be.eql("a"); - require("./loaders/syncloader!./loaders/asyncloader!./a").should.be.eql("a"); - require("./loaders/asyncloader!./loaders/syncloader!./a").should.be.eql("a"); - require("./loaders/asyncloader!./loaders/asyncloader!./a").should.be.eql("a"); + expect(require("./loaders/syncloader!./loaders/syncloader!./a")).toBe("a"); + expect(require("./loaders/syncloader!./loaders/asyncloader!./a")).toBe("a"); + expect(require("./loaders/asyncloader!./loaders/syncloader!./a")).toBe("a"); + expect(require("./loaders/asyncloader!./loaders/asyncloader!./a")).toBe("a"); - require("./loaders/asyncloader!./loaders/asyncloader!./loaders/asyncloader!./a").should.be.eql("a"); - require("./loaders/asyncloader!./loaders/syncloader!./loaders/asyncloader!./a").should.be.eql("a"); - require("./loaders/syncloader!./loaders/asyncloader!./loaders/syncloader!./a").should.be.eql("a"); - require("./loaders/syncloader!./loaders/syncloader!./loaders/syncloader!./a").should.be.eql("a"); + expect(require("./loaders/asyncloader!./loaders/asyncloader!./loaders/asyncloader!./a")).toBe("a"); + expect(require("./loaders/asyncloader!./loaders/syncloader!./loaders/asyncloader!./a")).toBe("a"); + expect(require("./loaders/syncloader!./loaders/asyncloader!./loaders/syncloader!./a")).toBe("a"); + expect(require("./loaders/syncloader!./loaders/syncloader!./loaders/syncloader!./a")).toBe("a"); }); diff --git a/test/cases/loaders/coffee-loader/index.js b/test/cases/loaders/coffee-loader/index.js index 2e0012214..be3924f1e 100644 --- a/test/cases/loaders/coffee-loader/index.js +++ b/test/cases/loaders/coffee-loader/index.js @@ -1,10 +1,10 @@ it("should handle the coffee loader correctly", function() { - require("!coffee-loader!../_resources/script.coffee").should.be.eql("coffee test"); - require("../_resources/script.coffee").should.be.eql("coffee test"); + expect(require("!coffee-loader!../_resources/script.coffee")).toBe("coffee test"); + expect(require("../_resources/script.coffee")).toBe("coffee test"); }); it("should handle literate coffee script correctly", function() { - require("!coffee-loader?literate!./script.coffee.md").should.be.eql("literate coffee test"); + expect(require("!coffee-loader?literate!./script.coffee.md")).toBe("literate coffee test"); }); it("should generate valid code with cheap-source-map", function() { diff --git a/test/cases/loaders/context/index.js b/test/cases/loaders/context/index.js index 833bebb10..9105d7d6f 100644 --- a/test/cases/loaders/context/index.js +++ b/test/cases/loaders/context/index.js @@ -1,5 +1,5 @@ it("should be able to use a context with a loader", function() { var abc = "abc", scr = "script.coffee"; - require("../_resources/" + scr).should.be.eql("coffee test"); - require("raw-loader!../_resources/" + abc + ".txt").should.be.eql("abc"); + expect(require("../_resources/" + scr)).toBe("coffee test"); + expect(require("raw-loader!../_resources/" + abc + ".txt")).toBe("abc"); }); diff --git a/test/cases/loaders/jade-loader/index.js b/test/cases/loaders/jade-loader/index.js index a30c1f92e..535b92f95 100644 --- a/test/cases/loaders/jade-loader/index.js +++ b/test/cases/loaders/jade-loader/index.js @@ -1,4 +1,4 @@ it("should handle the jade loader correctly", function() { - require("!jade-loader?self!../_resources/template.jade")({abc: "abc"}).should.be.eql("

selfabc

included

"); - require("../_resources/template.jade")({abc: "abc"}).should.be.eql("

abc

included

"); + require("!jade-loader?self!../_resources/template.jade")({abc: "abc"}expect()).toBe("

selfabc

included

"); + require("../_resources/template.jade")({abc: "abc"}expect()).toBe("

abc

included

"); }); diff --git a/test/cases/loaders/module-description-file/index.js b/test/cases/loaders/module-description-file/index.js index 385187584..ce5b36996 100644 --- a/test/cases/loaders/module-description-file/index.js +++ b/test/cases/loaders/module-description-file/index.js @@ -1,12 +1,12 @@ it("should run a loader from package.json", function() { - require("testloader!../_resources/abc.txt").should.be.eql("abcwebpack"); - require("testloader/lib/loader2!../_resources/abc.txt").should.be.eql("abcweb"); - require("testloader/lib/loader3!../_resources/abc.txt").should.be.eql("abcloader"); - require("testloader/lib/loader-indirect!../_resources/abc.txt").should.be.eql("abcwebpack"); + expect(require("testloader!../_resources/abc.txt")).toBe("abcwebpack"); + expect(require("testloader/lib/loader2!../_resources/abc.txt")).toBe("abcweb"); + expect(require("testloader/lib/loader3!../_resources/abc.txt")).toBe("abcloader"); + expect(require("testloader/lib/loader-indirect!../_resources/abc.txt")).toBe("abcwebpack"); }); it("should run a loader from .webpack-loader.js extension", function() { - require("testloader/lib/loader!../_resources/abc.txt").should.be.eql("abcwebpack"); + expect(require("testloader/lib/loader!../_resources/abc.txt")).toBe("abcwebpack"); }); it("should be able to pipe loaders", function() { - require("testloader!./reverseloader!../_resources/abc.txt").should.be.eql("cbawebpack"); + expect(require("testloader!./reverseloader!../_resources/abc.txt")).toBe("cbawebpack"); }); diff --git a/test/cases/loaders/query/index.js b/test/cases/loaders/query/index.js index 5ce94909a..faf5b0a72 100644 --- a/test/cases/loaders/query/index.js +++ b/test/cases/loaders/query/index.js @@ -1,6 +1,6 @@ it("should pass query to loader", function() { var result = require("./loaders/queryloader?query!./a?resourcequery"); - result.should.be.eql({ + expect(result).toEqual({ resourceQuery: "?resourcequery", query: "?query", prev: "module.exports = \"a\";" @@ -9,7 +9,7 @@ it("should pass query to loader", function() { it("should pass query to loader without resource with resource query", function() { var result = require("./loaders/queryloader?query!?resourcequery"); - result.should.be.eql({ + expect(result).toEqual({ resourceQuery: "?resourcequery", query: "?query", prev: null @@ -18,7 +18,7 @@ it("should pass query to loader without resource with resource query", function( it("should pass query to loader without resource", function() { var result = require("./loaders/queryloader?query!"); - result.should.be.eql({ + expect(result).toEqual({ query: "?query", prev: null }); @@ -39,7 +39,7 @@ it("should pass query to multiple loaders", function() { it("should pass query to loader over context", function() { var test = "test"; var result = require("./loaders/queryloader?query!./context-query-test/" + test); - result.should.be.eql({ + expect(result).toEqual({ resourceQuery: "", query: "?query", prev: "test content" diff --git a/test/cases/loaders/raw-loader/index.js b/test/cases/loaders/raw-loader/index.js index eb82ae080..5367de4e8 100644 --- a/test/cases/loaders/raw-loader/index.js +++ b/test/cases/loaders/raw-loader/index.js @@ -1,3 +1,3 @@ it("should handle the raw loader correctly", function() { - require("raw-loader!../_resources/abc.txt").should.be.eql("abc"); + expect(require("raw-loader!../_resources/abc.txt")).toBe("abc"); }); diff --git a/test/cases/mjs/cjs-import-default/index.mjs b/test/cases/mjs/cjs-import-default/index.mjs index 2e95cbb3a..8ec2bf986 100644 --- a/test/cases/mjs/cjs-import-default/index.mjs +++ b/test/cases/mjs/cjs-import-default/index.mjs @@ -5,26 +5,26 @@ import { ns, default as def1, def as def2, data as data2 } from "./reexport.mjs" import * as reexport from "./reexport.mjs"; it("should get correct values when importing named exports from a CommonJs module from mjs", function() { - (typeof data).should.be.eql("undefined"); - ({ data }).should.be.eql({ data: undefined }); - def.should.be.eql({ + expect((typeof data)).toBe("undefined"); + ({ data }expect()).toEqual({ data: undefined }); + expect(def).toEqual({ data: "ok", default: "default" }); - ({ def }).should.be.eql({ + ({ def }expect()).toEqual({ def: { data: "ok", default: "default" } }); const valueOf = "valueOf"; - star[valueOf]().should.be.eql({ + expect(star[valueOf]()).toEqual({ default: { data: "ok", default: "default" } }); - ({ star }).should.be.eql({ + ({ star }expect()).toEqual({ star: { default: { data: "ok", @@ -32,26 +32,26 @@ it("should get correct values when importing named exports from a CommonJs modul } } }); - star.default.should.be.eql({ + expect(star.default).toEqual({ data: "ok", default: "default" }); - ns.should.be.eql({ + expect(ns).toEqual({ default: { data: "ok", default: "default" } }); - def1.should.be.eql({ + expect(def1).toEqual({ data: "ok", default: "default" }); - def2.should.be.eql({ + expect(def2).toEqual({ data: "ok", default: "default" }); - (typeof data2).should.be.eql("undefined"); - reexport[valueOf]().should.be.eql({ + expect((typeof data2)).toBe("undefined"); + expect(reexport[valueOf]()).toEqual({ ns: { default: { data: "ok", diff --git a/test/cases/mjs/namespace-object-lazy/index.mjs b/test/cases/mjs/namespace-object-lazy/index.mjs index eafa15939..ca85ba72c 100644 --- a/test/cases/mjs/namespace-object-lazy/index.mjs +++ b/test/cases/mjs/namespace-object-lazy/index.mjs @@ -1,13 +1,13 @@ it("should receive a namespace object when importing commonjs", function(done) { import("./cjs.js").then(function(result) { - result.should.be.eql({ default: { named: "named", default: "default" } }); + expect(result).toEqual({ default: { named: "named", default: "default" } }); done(); }).catch(done); }); it("should receive a namespace object when importing commonjs with __esModule", function(done) { import("./cjs-esmodule.js").then(function(result) { - result.should.be.eql({ default: { __esModule: true, named: "named", default: "default" } }); + expect(result).toEqual({ default: { __esModule: true, named: "named", default: "default" } }); done(); }).catch(done); }); @@ -54,7 +54,7 @@ function contextMixed(name) { function promiseTest(promise, equalsTo) { return promise.then(function(results) { for(const result of results) - result.should.be.eql(equalsTo); + expect(result).toEqual(equalsTo); }); } diff --git a/test/cases/mjs/non-mjs-namespace-object-lazy/index.js b/test/cases/mjs/non-mjs-namespace-object-lazy/index.js index c44f3bfb9..72c296987 100644 --- a/test/cases/mjs/non-mjs-namespace-object-lazy/index.js +++ b/test/cases/mjs/non-mjs-namespace-object-lazy/index.js @@ -1,13 +1,13 @@ it("should receive a namespace object when importing commonjs", function(done) { import("./cjs").then(function(result) { - result.should.be.eql({ default: { named: "named", default: "default" } }); + expect(result).toEqual({ default: { named: "named", default: "default" } }); done(); }).catch(done); }); it("should receive a namespace object when importing commonjs with __esModule", function(done) { import("./cjs-esmodule").then(function(result) { - result.should.be.eql({ __esModule: true, named: "named", default: "default" }); + expect(result).toEqual({ __esModule: true, named: "named", default: "default" }); done(); }).catch(done); }); @@ -54,7 +54,7 @@ function contextMixed(name) { function promiseTest(promise, equalsTo) { return promise.then(function(results) { for(const result of results) - result.should.be.eql(equalsTo); + expect(result).toEqual(equalsTo); }); } diff --git a/test/cases/nonce/set-nonce/index.js b/test/cases/nonce/set-nonce/index.js index 5d742671f..9607ec97b 100644 --- a/test/cases/nonce/set-nonce/index.js +++ b/test/cases/nonce/set-nonce/index.js @@ -7,7 +7,7 @@ it("should load script with nonce 'nonce1234'", function(done) { // if in browser context, test that nonce was added. if (typeof document !== 'undefined') { var script = document.querySelector('script[src="js/chunk-with-nonce.web.js"]'); - script.getAttribute('nonce').should.be.eql('nonce1234'); + expect(script.getAttribute('nonce')).toBe('nonce1234'); } __webpack_nonce__ = undefined; done(); @@ -21,8 +21,8 @@ it("should load script without nonce", function(done) { // if in browser context, test that nonce was added. if (typeof document !== 'undefined') { var script = document.querySelector('script[src="js/chunk-without-nonce.web.js"]'); - script.hasAttribute('nonce').should.be.eql(false); + expect(script.hasAttribute('nonce')).toBe(false); } __webpack_nonce__ = undefined; done(); -}); \ No newline at end of file +}); diff --git a/test/cases/optimize/side-effects-all-chain-unused/index.js b/test/cases/optimize/side-effects-all-chain-unused/index.js index f4132b006..38a67a0eb 100644 --- a/test/cases/optimize/side-effects-all-chain-unused/index.js +++ b/test/cases/optimize/side-effects-all-chain-unused/index.js @@ -2,6 +2,6 @@ import { log } from "pmodule/tracker"; import { a } from "pmodule"; it("should not evaluate a chain of modules", function() { - a.should.be.eql("a"); - log.should.be.eql(["a.js"]); + expect(a).toBe("a"); + expect(log).toEqual(["a.js"]); }); diff --git a/test/cases/optimize/side-effects-all-used/index.js b/test/cases/optimize/side-effects-all-used/index.js index c5f6c2ffc..8838b9948 100644 --- a/test/cases/optimize/side-effects-all-used/index.js +++ b/test/cases/optimize/side-effects-all-used/index.js @@ -3,9 +3,9 @@ import { a, x, z } from "pmodule"; import def from "pmodule"; it("should evaluate all modules", function() { - def.should.be.eql("def"); - a.should.be.eql("a"); - x.should.be.eql("x"); - z.should.be.eql("z"); - log.should.be.eql(["a.js", "b.js", "c.js", "index.js"]); + expect(def).toBe("def"); + expect(a).toBe("a"); + expect(x).toBe("x"); + expect(z).toBe("z"); + expect(log).toEqual(["a.js", "b.js", "c.js", "index.js"]); }); diff --git a/test/cases/optimize/side-effects-immediate-unused/index.js b/test/cases/optimize/side-effects-immediate-unused/index.js index 65b5c767a..4a9b783c9 100644 --- a/test/cases/optimize/side-effects-immediate-unused/index.js +++ b/test/cases/optimize/side-effects-immediate-unused/index.js @@ -2,7 +2,7 @@ import { log } from "pmodule/tracker"; import { a, z } from "pmodule"; it("should not evaluate an immediate module", function() { - a.should.be.eql("a"); - z.should.be.eql("z"); - log.should.be.eql(["a.js", "c.js"]); + expect(a).toBe("a"); + expect(z).toBe("z"); + expect(log).toEqual(["a.js", "c.js"]); }); diff --git a/test/cases/optimize/side-effects-reexport-start-unknown/index.js b/test/cases/optimize/side-effects-reexport-start-unknown/index.js index e23690e91..6dfb96eaa 100644 --- a/test/cases/optimize/side-effects-reexport-start-unknown/index.js +++ b/test/cases/optimize/side-effects-reexport-start-unknown/index.js @@ -2,5 +2,5 @@ import * as m from "m"; it("should handle unknown exports fine", function() { var x = m; - x.should.be.eql({ foo: "foo" }); + expect(x).toEqual({ foo: "foo" }); }); diff --git a/test/cases/optimize/side-effects-root-unused/index.js b/test/cases/optimize/side-effects-root-unused/index.js index 36980ebab..22e4427cb 100644 --- a/test/cases/optimize/side-effects-root-unused/index.js +++ b/test/cases/optimize/side-effects-root-unused/index.js @@ -2,8 +2,8 @@ import { log } from "pmodule/tracker"; import { a, x, z } from "pmodule"; it("should evaluate all modules", function() { - a.should.be.eql("a"); - x.should.be.eql("x"); - z.should.be.eql("z"); - log.should.be.eql(["a.js", "b.js", "c.js"]); + expect(a).toBe("a"); + expect(x).toBe("x"); + expect(z).toBe("z"); + expect(log).toEqual(["a.js", "b.js", "c.js"]); }); diff --git a/test/cases/optimize/side-effects-simple-unused/index.js b/test/cases/optimize/side-effects-simple-unused/index.js index 70de17426..6e14a2b1a 100644 --- a/test/cases/optimize/side-effects-simple-unused/index.js +++ b/test/cases/optimize/side-effects-simple-unused/index.js @@ -3,8 +3,8 @@ import { x, z } from "pmodule"; import def from "pmodule"; it("should not evaluate a simple unused module", function() { - def.should.be.eql("def"); - x.should.be.eql("x"); - z.should.be.eql("z"); - log.should.be.eql(["b.js", "c.js", "index.js"]); + expect(def).toBe("def"); + expect(x).toBe("x"); + expect(z).toBe("z"); + expect(log).toEqual(["b.js", "c.js", "index.js"]); }); diff --git a/test/cases/optimize/side-effects-transitive-unused/index.js b/test/cases/optimize/side-effects-transitive-unused/index.js index 5da932f05..007064fbf 100644 --- a/test/cases/optimize/side-effects-transitive-unused/index.js +++ b/test/cases/optimize/side-effects-transitive-unused/index.js @@ -2,7 +2,7 @@ import { log } from "pmodule/tracker"; import { a, y } from "pmodule"; it("should not evaluate a reexporting transitive module", function() { - a.should.be.eql("a"); - y.should.be.eql("y"); - log.should.be.eql(["a.js", "b.js"]); + expect(a).toBe("a"); + expect(y).toBe("y"); + expect(log).toEqual(["a.js", "b.js"]); }); diff --git a/test/cases/optimize/tree-shaking-commonjs/index.js b/test/cases/optimize/tree-shaking-commonjs/index.js index e7cee8bee..0340d09aa 100644 --- a/test/cases/optimize/tree-shaking-commonjs/index.js +++ b/test/cases/optimize/tree-shaking-commonjs/index.js @@ -1,5 +1,5 @@ import { test } from "./a"; it("should correctly tree shake star exports", function() { - test.should.be.eql(123); + expect(test).toBe(123); }); diff --git a/test/cases/optimize/tree-shaking-star/index.js b/test/cases/optimize/tree-shaking-star/index.js index 231747efb..479be1363 100644 --- a/test/cases/optimize/tree-shaking-star/index.js +++ b/test/cases/optimize/tree-shaking-star/index.js @@ -2,7 +2,7 @@ import { test } from "./a"; import { func1, func3 } from "./x"; it("should correctly tree shake star exports", function() { - test.should.be.eql(123); - func1().should.be.eql("func1"); - func3().should.be.eql("func3"); + expect(test).toBe(123); + expect(func1()).toBe("func1"); + expect(func3()).toBe("func3"); }); diff --git a/test/cases/optimize/tree-shaking-star2/index.js b/test/cases/optimize/tree-shaking-star2/index.js index b8bb5764b..7b516994a 100644 --- a/test/cases/optimize/tree-shaking-star2/index.js +++ b/test/cases/optimize/tree-shaking-star2/index.js @@ -3,10 +3,10 @@ import { aa as aa2, d } from "./root3"; var root6 = require("./root6"); it("should correctly tree shake star exports", function() { - aa.should.be.eql("aa"); - aa2.should.be.eql("aa"); - d.should.be.eql("d"); - root6.should.be.eql({ + expect(aa).toBe("aa"); + expect(aa2).toBe("aa"); + expect(d).toBe("d"); + expect(root6).toEqual({ aa: "aa", c: "c" }); diff --git a/test/cases/parsing/amd-rename/index.js b/test/cases/parsing/amd-rename/index.js index 42658e5be..be0d7347a 100644 --- a/test/cases/parsing/amd-rename/index.js +++ b/test/cases/parsing/amd-rename/index.js @@ -1,5 +1,5 @@ it("should name require in define correctly", function() { define(["require"], function(require) { - (typeof require).should.be.eql("function"); + expect((typeof require)).toBe("function"); }); }); diff --git a/test/cases/parsing/bom/index.js b/test/cases/parsing/bom/index.js index f10161634..a2bbda8ee 100644 --- a/test/cases/parsing/bom/index.js +++ b/test/cases/parsing/bom/index.js @@ -1,9 +1,9 @@ it("should load a utf-8 file with BOM", function() { var result = require("./bomfile"); - result.should.be.eql("ok"); + expect(result).toEqual("ok"); }); it("should load a css file with BOM", function() { var css = require("!css-loader!./bomfile.css") + ""; - css.should.be.eql("body{color:#abc}"); + expect(css).toBe("body{color:#abc}"); }); diff --git a/test/cases/parsing/browserify/index.js b/test/cases/parsing/browserify/index.js index a1c656ae4..835558569 100644 --- a/test/cases/parsing/browserify/index.js +++ b/test/cases/parsing/browserify/index.js @@ -10,5 +10,5 @@ it("should be able to parse browserified modules (UMD)", function() { },{}]},{},[1]) (1) }); - module.exports.should.be.eql(1234); -}); \ No newline at end of file + expect(module.exports).toBe(1234); +}); diff --git a/test/cases/parsing/chunks/index.js b/test/cases/parsing/chunks/index.js index 8a1afd3ac..e419644c6 100644 --- a/test/cases/parsing/chunks/index.js +++ b/test/cases/parsing/chunks/index.js @@ -1,7 +1,7 @@ it("should parse a Coffeescript style function expression in require.ensure", function(done) { require.ensure([], (function(_this) { return function(require) { - require("./file").should.be.eql("ok"); + expect(require("./file")).toBe("ok"); done(); }; }(this))); @@ -9,28 +9,28 @@ it("should parse a Coffeescript style function expression in require.ensure", fu it("should parse a bound function expression in require.ensure", function(done) { require.ensure([], function(require) { - require("./file").should.be.eql("ok"); + expect(require("./file")).toBe("ok"); done(); }.bind(this)); }); it("should parse a string in require.ensure", function(done) { require.ensure("./file", function(require) { - require("./file").should.be.eql("ok"); + expect(require("./file")).toBe("ok"); done(); }); }); it("should parse a string in require.ensure with arrow function expression", function(done) { require.ensure("./file", require => { - require("./file").should.be.eql("ok"); + expect(require("./file")).toBe("ok"); done(); }); }); it("should parse a string in require.ensure with arrow function array expression", function(done) { - require.ensure("./file", require => (require("./file").should.be.eql("ok"), done())); + require.ensure("./file", require =>expect( (require("./file")).toBe("ok"), done())); }); diff --git a/test/cases/parsing/class/index.js b/test/cases/parsing/class/index.js index 74e55e418..c58c505fc 100644 --- a/test/cases/parsing/class/index.js +++ b/test/cases/parsing/class/index.js @@ -1,12 +1,12 @@ import X, { A, B } from "./module"; it("should parse classes", function() { - new X().a.should.be.eql("ok"); - new A().a.should.be.eql("ok"); - new B().a.should.be.eql("ok"); + expect(new X().a).toBe("ok"); + expect(new A().a).toBe("ok"); + expect(new B().a).toBe("ok"); }); it("should parse methods", function() { - new X().b().should.be.eql("ok"); - X.c().should.be.eql("ok"); + expect(new X().b()).toBe("ok"); + expect(X.c()).toBe("ok"); }); diff --git a/test/cases/parsing/context/index.js b/test/cases/parsing/context/index.js index 6c6c3bf6e..26bd132c3 100644 --- a/test/cases/parsing/context/index.js +++ b/test/cases/parsing/context/index.js @@ -1,28 +1,28 @@ it("should be able to load a file with the require.context method", function() { - require.context("./templates")("./tmpl").should.be.eql("test template"); - (require.context("./././templates"))("./tmpl").should.be.eql("test template"); - (require.context("././templates/.")("./tmpl")).should.be.eql("test template"); - require.context("./loaders/queryloader?dog=bark!./templates?cat=meow")("./tmpl").should.be.eql({ + expect(require.context("./templates")("./tmpl")).toBe("test template"); + expect((require.context("./././templates"))("./tmpl")).toBe("test template"); + expect((require.context("././templates/.")("./tmpl"))).toBe("test template"); + expect(require.context("./loaders/queryloader?dog=bark!./templates?cat=meow")("./tmpl")).toEqual({ resourceQuery: "?cat=meow", query: "?dog=bark", prev: "module.exports = \"test template\";" }); - require . context ( "." + "/." + "/" + "templ" + "ates" ) ( "./subdir/tmpl.js" ).should.be.eql("subdir test template"); - require.context("./templates", true, /./)("xyz").should.be.eql("xyz"); + expect(require . context ( "." + "/." + "/" + "templ" + "ates" ) ( "./subdir/tmpl.js" )).toBe("subdir test template"); + expect(require.context("./templates", true, /./)("xyz")).toBe("xyz"); }); it("should automatically create contexts", function() { var template = "tmpl", templateFull = "./tmpl.js"; var mp = "mp", tmp = "tmp", mpl = "mpl"; - require("./templates/" + template).should.be.eql("test template"); - require("./templates/" + tmp + "l").should.be.eql("test template"); - require("./templates/t" + mpl).should.be.eql("test template"); - require("./templates/t" + mp + "l").should.be.eql("test template"); + expect(require("./templates/" + template)).toBe("test template"); + expect(require("./templates/" + tmp + "l")).toBe("test template"); + expect(require("./templates/t" + mpl)).toBe("test template"); + expect(require("./templates/t" + mp + "l")).toBe("test template"); }); it("should be able to require.resolve with automatical context", function() { var template = "tmpl"; - require.resolve("./templates/" + template).should.be.eql(require.resolve("./templates/tmpl")); + expect(require.resolve("./templates/" + template)).toBe(require.resolve("./templates/tmpl")); }); it("should be able to use renaming combined with a context", function() { @@ -30,7 +30,7 @@ it("should be able to use renaming combined with a context", function() { require = function () {}; require("fail"); var template = "tmpl"; - renamedRequire("./templates/" + template).should.be.eql("test template"); + expect(renamedRequire("./templates/" + template)).toBe("test template"); }); it("should compile an empty context", function() { diff --git a/test/cases/parsing/es6.nominimize/index.js b/test/cases/parsing/es6.nominimize/index.js index 8d77c7059..239bc932b 100644 --- a/test/cases/parsing/es6.nominimize/index.js +++ b/test/cases/parsing/es6.nominimize/index.js @@ -19,21 +19,21 @@ it("should parse classes", function() { var x = new MyClass(); - x.a.should.be.eql("a"); - x.func().should.be.eql("b"); - x.c().should.be.eql("c"); + expect(x.a).toBe("a"); + expect(x.func()).toBe("b"); + expect(x.c()).toBe("c"); }); it("should parse spread operator"/*, function() { - [0, ...require("./array")].should.be.eql([0, 1, 2, 3]); - ({z: 0, ...require("./object")}).should.be.eql({z: 0, a: 1, b: 2, c: 3}); + expect([0, ...require("./array")]).toEqual([0, 1, 2, 3]); + ({z: 0, ...require("./object")}expect()).toEqual({z: 0, a: 1, b: 2, c: 3}); }*/); it("should parse arrow function", function() { - (() => require("./a"))().should.be.eql("a"); + (() =>expect( require("./a"))()).toBe("a"); (() => { return require("./a"); - })().should.be.eql("a"); + }expect()()).toBe("a"); require.ensure([], () => { require("./a"); }); @@ -53,8 +53,8 @@ it("should parse template literals", function() { } var x = `a${require("./b")}c`; var y = tag`a${require("./b")}c`; - x.should.be.eql("abc"); - y.should.be.eql("b"); + expect(x).toBe("abc"); + expect(y).toBe("b"); }) it("should parse generators and yield", function() { @@ -63,7 +63,7 @@ it("should parse generators and yield", function() { yield require("./b"); } var x = gen(); - x.next().value.should.be.eql("a"); - x.next().value.should.be.eql("b"); - x.next().done.should.be.eql(true); + expect(x.next().value).toBe("a"); + expect(x.next().value).toBe("b"); + expect(x.next().done).toBe(true); }) diff --git a/test/cases/parsing/evaluate/index.js b/test/cases/parsing/evaluate/index.js index e29556ebf..f2be9d888 100644 --- a/test/cases/parsing/evaluate/index.js +++ b/test/cases/parsing/evaluate/index.js @@ -7,7 +7,7 @@ it("should evaluate null", function() { if("shouldn't evaluate expression", function() { var value = ""; var x = (value + "") ? "fail" : "ok"; - x.should.be.eql("ok"); + expect(x).toBe("ok"); }); it("should short-circut evaluating", function() { @@ -18,5 +18,5 @@ it("should short-circut evaluating", function() { it("should evaluate __dirname and __resourceQuery with replace and substr", function() { var result = require("./resourceQuery/index?" + __dirname); - result.should.be.eql("?resourceQuery"); + expect(result).toEqual("?resourceQuery"); }); diff --git a/test/cases/parsing/extract-amd.nominimize/index.js b/test/cases/parsing/extract-amd.nominimize/index.js index f125efeed..8473996cb 100644 --- a/test/cases/parsing/extract-amd.nominimize/index.js +++ b/test/cases/parsing/extract-amd.nominimize/index.js @@ -20,36 +20,36 @@ it("should parse fancy function calls with arrow functions", function() { it("should parse fancy AMD calls with arrow functions", function() { require("./constructor ./a".split(" ")); require("-> module module exports *constructor *a".replace("module", "require").substr(3).replace(/\*/g, "./").split(" "), (require, module, exports, constructor, a) => { - (typeof require).should.be.eql("function"); - (typeof module).should.be.eql("object"); - (typeof exports).should.be.eql("object"); - (typeof require("./constructor")).should.be.eql("function"); - (typeof constructor).should.be.eql("function"); - a.should.be.eql("a"); + expect((typeof require)).toBe("function"); + expect((typeof module)).toBe("object"); + expect((typeof exports)).toBe("object"); + expect((typeof require("./constructor"))).toBe("function"); + expect((typeof constructor)).toBe("function"); + expect(a).toBe("a"); }); define("-> module module exports *constructor *a".replace("module", "require").substr(3).replace(/\*/g, "./").split(" "), (require, module, exports, constructor, a) => { - (typeof require).should.be.eql("function"); - (typeof module).should.be.eql("object"); - (typeof exports).should.be.eql("object"); - (typeof require("./constructor")).should.be.eql("function"); - (typeof constructor).should.be.eql("function"); - a.should.be.eql("a"); + expect((typeof require)).toBe("function"); + expect((typeof module)).toBe("object"); + expect((typeof exports)).toBe("object"); + expect((typeof require("./constructor"))).toBe("function"); + expect((typeof constructor)).toBe("function"); + expect(a).toBe("a"); }); }); it("should be able to use AMD-style require with arrow functions", function(done) { var template = "b"; require(["./circular", "./templates/" + template, true ? "./circular" : "fail"], (circular, testTemplate, circular2) => { - circular.should.be.eql(1); - circular2.should.be.eql(1); - testTemplate.should.be.eql("b"); + expect(circular).toBe(1); + expect(circular2).toBe(1); + expect(testTemplate).toBe("b"); done(); }); }); it("should be able to use require.js-style define with arrow functions", function(done) { define("name", ["./circular"], (circular) => { - circular.should.be.eql(1); + expect(circular).toBe(1); done(); }); }); @@ -63,14 +63,14 @@ it("should be able to use require.js-style define, optional dependancies, not ex it("should be able to use require.js-style define, special string, with arrow function", function(done) { define(["require"], (require) => { - require("./circular").should.be.eql(1); + expect(require("./circular")).toBe(1); done(); }); }); it("should be able to use require.js-style define, without name, with arrow function", function(done) { true && define(["./circular"], (circular) => { - circular.should.be.eql(1); + expect(circular).toBe(1); done(); }); }); @@ -91,17 +91,17 @@ it("should offer AMD-style define for CommonJs with arrow function", function(do var _test_exports = exports; var _test_module = module; define((require, exports, module) => { - (typeof require).should.be.eql("function"); + expect((typeof require)).toBe("function"); exports.should.be.equal(_test_exports); module.should.be.equal(_test_module); - require("./circular").should.be.eql(1); + expect(require("./circular")).toBe(1); done(); }); }); it("should pull in all dependencies of an AMD module with arrow function", function(done) { define((require) => { - require("./amdmodule").should.be.eql("a"); + expect(require("./amdmodule")).toBe("a"); done(); }); }); @@ -109,9 +109,9 @@ it("should pull in all dependencies of an AMD module with arrow function", funct it("should create a chunk for require.js require, with arrow function", function(done) { var sameTick = true; require(["./c"], (c) => { - sameTick.should.be.eql(false); - c.should.be.eql("c"); - require("./d").should.be.eql("d"); + expect(sameTick).toBe(false); + expect(c).toBe("c"); + expect(require("./d")).toBe("d"); done(); }); sameTick = false; diff --git a/test/cases/parsing/extract-amd/index.js b/test/cases/parsing/extract-amd/index.js index 5b7738002..28c3ef906 100644 --- a/test/cases/parsing/extract-amd/index.js +++ b/test/cases/parsing/extract-amd/index.js @@ -20,36 +20,36 @@ it("should parse fancy function calls", function() { it("should parse fancy AMD calls", function() { require("./constructor ./a".split(" ")); require("-> module module exports *constructor *a".replace("module", "require").substr(3).replace(/\*/g, "./").split(" "), function(require, module, exports, constructor, a) { - (typeof require).should.be.eql("function"); - (typeof module).should.be.eql("object"); - (typeof exports).should.be.eql("object"); - (typeof require("./constructor")).should.be.eql("function"); - (typeof constructor).should.be.eql("function"); - a.should.be.eql("a"); + expect((typeof require)).toBe("function"); + expect((typeof module)).toBe("object"); + expect((typeof exports)).toBe("object"); + expect((typeof require("./constructor"))).toBe("function"); + expect((typeof constructor)).toBe("function"); + expect(a).toBe("a"); }); define("-> module module exports *constructor *a".replace("module", "require").substr(3).replace(/\*/g, "./").split(" "), function(require, module, exports, constructor, a) { - (typeof require).should.be.eql("function"); - (typeof module).should.be.eql("object"); - (typeof exports).should.be.eql("object"); - (typeof require("./constructor")).should.be.eql("function"); - (typeof constructor).should.be.eql("function"); - a.should.be.eql("a"); + expect((typeof require)).toBe("function"); + expect((typeof module)).toBe("object"); + expect((typeof exports)).toBe("object"); + expect((typeof require("./constructor"))).toBe("function"); + expect((typeof constructor)).toBe("function"); + expect(a).toBe("a"); }); }); it("should be able to use AMD-style require", function(done) { var template = "b"; require(["./circular", "./templates/" + template, true ? "./circular" : "fail"], function(circular, testTemplate, circular2) { - circular.should.be.eql(1); - circular2.should.be.eql(1); - testTemplate.should.be.eql("b"); + expect(circular).toBe(1); + expect(circular2).toBe(1); + expect(testTemplate).toBe("b"); done(); }); }); it("should be able to use require.js-style define", function(done) { define("name", ["./circular"], function(circular) { - circular.should.be.eql(1); + expect(circular).toBe(1); done(); }); }); @@ -63,14 +63,14 @@ it("should be able to use require.js-style define, optional dependancies, not ex it("should be able to use require.js-style define, special string", function(done) { define(["require"], function(require) { - require("./circular").should.be.eql(1); + expect(require("./circular")).toBe(1); done(); }); }); it("should be able to use require.js-style define, without name", function(done) { true && define(["./circular"], function(circular) { - circular.should.be.eql(1); + expect(circular).toBe(1); done(); }); }); @@ -120,10 +120,10 @@ it("should offer AMD-style define for CommonJs", function(done) { var _test_exports = exports; var _test_module = module; define(function(require, exports, module) { - (typeof require).should.be.eql("function"); + expect((typeof require)).toBe("function"); exports.should.be.equal(_test_exports); module.should.be.equal(_test_module); - require("./circular").should.be.eql(1); + expect(require("./circular")).toBe(1); done(); }); }); @@ -140,7 +140,7 @@ it("should be able to use AMD require without function expression (empty array)" it("should be able to use AMD require without function expression", function(done) { require(["./circular"], fn); function fn(c) { - c.should.be.eql(1); + expect(c).toBe(1); done(); } }); @@ -148,9 +148,9 @@ it("should be able to use AMD require without function expression", function(don it("should create a chunk for require.js require", function(done) { var sameTick = true; require(["./c"], function(c) { - sameTick.should.be.eql(false); - c.should.be.eql("c"); - require("./d").should.be.eql("d"); + expect(sameTick).toBe(false); + expect(c).toBe("c"); + expect(require("./d")).toBe("d"); done(); }); sameTick = false; @@ -170,34 +170,34 @@ it("should not fail #138", function(done) { it("should parse a bound function expression 1", function(done) { define(function(a, require, exports, module) { - a.should.be.eql(123); - (typeof require).should.be.eql("function"); - require("./a").should.be.eql("a"); + expect(a).toBe(123); + expect((typeof require)).toBe("function"); + expect(require("./a")).toBe("a"); done(); }.bind(null, 123)); }); it("should parse a bound function expression 2", function(done) { define("name", function(a, require, exports, module) { - a.should.be.eql(123); - (typeof require).should.be.eql("function"); - require("./a").should.be.eql("a"); + expect(a).toBe(123); + expect((typeof require)).toBe("function"); + expect(require("./a")).toBe("a"); done(); }.bind(null, 123)); }); it("should parse a bound function expression 3", function(done) { define(["./a"], function(number, a) { - number.should.be.eql(123); - a.should.be.eql("a"); + expect(number).toBe(123); + expect(a).toBe("a"); done(); }.bind(null, 123)); }); it("should parse a bound function expression 4", function(done) { define("name", ["./a"], function(number, a) { - number.should.be.eql(123); - a.should.be.eql("a"); + expect(number).toBe(123); + expect(a).toBe("a"); done(); }.bind(null, 123)); }); @@ -205,21 +205,21 @@ it("should parse a bound function expression 4", function(done) { it("should not fail issue #138 second", function() { (function(define, global) { 'use strict'; define(function (require) { - (typeof require).should.be.eql("function"); - require("./a").should.be.eql("a"); + expect((typeof require)).toBe("function"); + expect(require("./a")).toBe("a"); return "#138 2."; }); })(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); }, this); - module.exports.should.be.eql("#138 2."); + expect(module.exports).toBe("#138 2."); }); it("should parse an define with empty array and object", function() { var obj = {ok: 95476}; define([], obj); - module.exports.should.be.eql(obj); + expect(module.exports).toBe(obj); }); it("should parse an define with object", function() { var obj = {ok: 76243}; define(obj); - module.exports.should.be.eql(obj); + expect(module.exports).toBe(obj); }); diff --git a/test/cases/parsing/extract-require/index.js b/test/cases/parsing/extract-require/index.js index 02fb20870..60c4055a6 100644 --- a/test/cases/parsing/extract-require/index.js +++ b/test/cases/parsing/extract-require/index.js @@ -1,13 +1,13 @@ var should = require("should"); function testCase(number) { - require(number === 1 ? "./folder/file1" : number === 2 ? "./folder/file2" : number === 3 ? "./folder/file3" : "./missingModule").should.be.eql("file" + number); + expect(require(number === 1 ? "./folder/file1" : number === 2 ? "./folder/file2" : number === 3 ? "./folder/file3" : "./missingModule")).toBe("file" + number); require( number === 1 ? "./folder/file1" : number === 2 ? "./folder/file2" : number === 3 ? "./folder/file3" : "./missingModule" - ).should.be.eql("file" + number); + expect()).toBe("file" + number); } it("should parse complex require calls", function() { @@ -16,24 +16,24 @@ it("should parse complex require calls", function() { }); it("should let the user hide the require function", function() { - (function(require) { return require; }(1234)).should.be.eql(1234); + (function(require) { return require; }expect((1234))).toBe(1234); function testFunc(abc, require) { return require; } - testFunc(333, 678).should.be.eql(678); + expect(testFunc(333, 678)).toBe(678); (function() { var require = 123; - require.should.be.eql(123); + expect(require).toBe(123); }()); (function() { function require() { return 123; }; - require("error").should.be.eql(123); + expect(require("error")).toBe(123); }()); (function() { var module = 1233; - module.should.be.eql(1233); + expect(module).toBe(1233); }()); }); diff --git a/test/cases/parsing/harmony-commonjs-mix/index.js b/test/cases/parsing/harmony-commonjs-mix/index.js index 6383d861f..bc390fdf5 100644 --- a/test/cases/parsing/harmony-commonjs-mix/index.js +++ b/test/cases/parsing/harmony-commonjs-mix/index.js @@ -1,4 +1,4 @@ it("should result in a warning when using module.exports in harmony module", function() { var x = require("./module1"); - x.should.be.eql({default: 1234}); + expect(x).toEqual({default: 1234}); }); diff --git a/test/cases/parsing/harmony-commonjs-mix/module1.js b/test/cases/parsing/harmony-commonjs-mix/module1.js index ab456ad0a..4514c4299 100644 --- a/test/cases/parsing/harmony-commonjs-mix/module1.js +++ b/test/cases/parsing/harmony-commonjs-mix/module1.js @@ -4,9 +4,9 @@ import "./module"; module.exports = 1; }).should.throw(); -(typeof module.exports).should.be.eql("undefined"); +expect((typeof module.exports)).toBe("undefined"); -(typeof define).should.be.eql("undefined"); +expect((typeof define)).toBe("undefined"); (function() { define(function() {}) }).should.throw(/define is not defined/); @@ -15,5 +15,5 @@ export default 1234; if(eval("typeof exports !== \"undefined\"")) { // exports is node.js exports and not webpacks - Object.keys(exports).should.be.eql([]); + expect(Object.keys(exports)).toEqual([]); } diff --git a/test/cases/parsing/harmony-commonjs/index.js b/test/cases/parsing/harmony-commonjs/index.js index ba4245f15..cfc2b9c4c 100644 --- a/test/cases/parsing/harmony-commonjs/index.js +++ b/test/cases/parsing/harmony-commonjs/index.js @@ -2,7 +2,7 @@ import { x, y } from "./b"; it("should pass when required by CommonJS module", function () { var test1 = require('./a').default; - test1().should.be.eql("OK"); + expect(test1()).toBe("OK"); }); it("should pass when use babeljs transpiler", function() { @@ -13,18 +13,18 @@ it("should pass when use babeljs transpiler", function() { var _test2 = _interopRequireDefault(_test); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var test2 = (0, _test2.default)(); - test2.should.be.eql("OK"); + expect(test2).toBe("OK"); }); it("should double reexport from non-harmony modules correctly", function() { - y.should.be.eql("y"); - x.should.be.eql("x"); + expect(y).toBe("y"); + expect(x).toBe("x"); }); import { a, b } from "./reexport" it("should be possible to reexport a module with unknown exports", function() { - a.should.be.eql("a"); - b.should.be.eql("b"); + expect(a).toBe("a"); + expect(b).toBe("b"); }); diff --git a/test/cases/parsing/harmony-duplicate-export/index.js b/test/cases/parsing/harmony-duplicate-export/index.js index 54bbf91db..b9be967f8 100644 --- a/test/cases/parsing/harmony-duplicate-export/index.js +++ b/test/cases/parsing/harmony-duplicate-export/index.js @@ -15,21 +15,21 @@ var y6 = require("./6?b").x; var y7 = require("./7?b").x; it("should not overwrite when using star export (known exports)", function() { - x1.should.be.eql("1"); - x2.should.be.eql("1"); - x3.should.be.eql("a"); - x4.should.be.eql("b"); - x5.should.be.eql("c"); - x6.should.be.eql("a"); - x7.should.be.eql("d"); + expect(x1).toBe("1"); + expect(x2).toBe("1"); + expect(x3).toBe("a"); + expect(x4).toBe("b"); + expect(x5).toBe("c"); + expect(x6).toBe("a"); + expect(x7).toBe("d"); }); it("should not overwrite when using star export (unknown exports)", function() { - y1.should.be.eql("1"); - y2.should.be.eql("1"); - y3.should.be.eql("a"); - y4.should.be.eql("b"); - y5.should.be.eql("c"); - y6.should.be.eql("a"); - y7.should.be.eql("d"); + expect(y1).toBe("1"); + expect(y2).toBe("1"); + expect(y3).toBe("a"); + expect(y4).toBe("b"); + expect(y5).toBe("c"); + expect(y6).toBe("a"); + expect(y7).toBe("d"); }); diff --git a/test/cases/parsing/harmony-edge-cases/index.js b/test/cases/parsing/harmony-edge-cases/index.js index ff252435b..965fb3150 100644 --- a/test/cases/parsing/harmony-edge-cases/index.js +++ b/test/cases/parsing/harmony-edge-cases/index.js @@ -3,9 +3,9 @@ import x, { b } from "./b"; import { c, d } from "./fake-reexport"; it("should be able to use exported function", function() { - a.should.be.eql("ok"); - b.should.be.eql("ok"); - x().should.be.eql("ok"); - c.should.be.eql("ok"); - d.should.be.eql("ok"); + expect(a).toBe("ok"); + expect(b).toBe("ok"); + expect(x()).toBe("ok"); + expect(c).toBe("ok"); + expect(d).toBe("ok"); }); diff --git a/test/cases/parsing/harmony-export-hoist/index.js b/test/cases/parsing/harmony-export-hoist/index.js index 8ae8ff1e9..05aecdbab 100644 --- a/test/cases/parsing/harmony-export-hoist/index.js +++ b/test/cases/parsing/harmony-export-hoist/index.js @@ -4,6 +4,6 @@ it("should hoist exports", function() { var result = require("./foo").default; (typeof result.foo).should.have.eql("function"); (typeof result.foo2).should.have.eql("function"); - result.foo().should.be.eql("ok"); - result.foo2().should.be.eql("ok"); + expect(result.foo()).toBe("ok"); + expect(result.foo2()).toBe("ok"); }); diff --git a/test/cases/parsing/harmony-export-precedence/index.js b/test/cases/parsing/harmony-export-precedence/index.js index 83a1181a8..dfdaf6683 100644 --- a/test/cases/parsing/harmony-export-precedence/index.js +++ b/test/cases/parsing/harmony-export-precedence/index.js @@ -3,19 +3,19 @@ import { a, b, c, d, e } from "./a"; import defaultImport from "./a"; it("should prefer local exports", function() { - a().should.be.eql("a1"); - e.should.be.eql("e1"); + expect(a()).toBe("a1"); + expect(e).toBe("e1"); }); it("should prefer indirect exports over star exports", function() { - b.should.be.eql("b2"); - d.should.be.eql("d2"); + expect(b).toBe("b2"); + expect(d).toBe("d2"); }); it("should use star exports", function() { - c.should.be.eql("c3"); + expect(c).toBe("c3"); }); it("should not export default via star export", function() { - (typeof defaultImport).should.be.eql("undefined"); + expect((typeof defaultImport)).toBe("undefined"); }); diff --git a/test/cases/parsing/harmony-import-export-order/index.js b/test/cases/parsing/harmony-import-export-order/index.js index 3c0e34d85..4ba8b05c8 100644 --- a/test/cases/parsing/harmony-import-export-order/index.js +++ b/test/cases/parsing/harmony-import-export-order/index.js @@ -3,8 +3,8 @@ it("should process imports of star exports in the correct order", function() { tracker.list.length = 0; delete require.cache[require.resolve("./c")]; var c = require("./c"); - tracker.list.should.be.eql(["a", "b", "c"]); - c.ax.should.be.eql("ax"); - c.bx.should.be.eql("ax"); - c.cx.should.be.eql("ax"); + expect(tracker.list).toEqual(["a", "b", "c"]); + expect(c.ax).toBe("ax"); + expect(c.bx).toBe("ax"); + expect(c.cx).toBe("ax"); }); diff --git a/test/cases/parsing/harmony-import-targets/index.js b/test/cases/parsing/harmony-import-targets/index.js index 66b1a645f..6eac34c85 100644 --- a/test/cases/parsing/harmony-import-targets/index.js +++ b/test/cases/parsing/harmony-import-targets/index.js @@ -1,9 +1,9 @@ import {x, f} from "./x"; it("should import into object literal", function() { - ({ x: x }).should.be.eql({x: 1}); + ({ x: x }expect()).toEqual({x: 1}); var obj = { x: x }; - obj.should.be.eql({x: 1}); + expect(obj).toEqual({x: 1}); }); function func(z) { @@ -11,21 +11,21 @@ function func(z) { } it("should import into function argument", function() { - func(x).should.be.eql(1); - f(x).should.be.eql(1); - func({x:x}).should.be.eql({x:1}); - f({x:x}).should.be.eql({x:1}); + expect(func(x)).toBe(1); + expect(f(x)).toBe(1); + func({x:x}expect()).toEqual({x:1}); + f({x:x}expect()).toEqual({x:1}); var y = f(x); - y.should.be.eql(1); + expect(y).toBe(1); y = function() { return x; }; - y().should.be.eql(1); + expect(y()).toBe(1); }); it("should import into array literal", function() { - ([x, f(2)]).should.be.eql([1, 2]); + expect(([x, f(2)])).toEqual([1, 2]); ([{ value: x - }]).should.be.eql([{ value: x }]); + }expect(])).toEqual([{ value: x }]); }); diff --git a/test/cases/parsing/harmony-injecting-order/index.js b/test/cases/parsing/harmony-injecting-order/index.js index 88d344b69..e61841e8c 100644 --- a/test/cases/parsing/harmony-injecting-order/index.js +++ b/test/cases/parsing/harmony-injecting-order/index.js @@ -1,3 +1,3 @@ it("should inject variables before exporting", function() { - require("./file").f().should.be.eql({}); + expect(require("./file").f()).toEqual({}); }); diff --git a/test/cases/parsing/harmony-spec/index.js b/test/cases/parsing/harmony-spec/index.js index d4e12cddc..59a1517ab 100644 --- a/test/cases/parsing/harmony-spec/index.js +++ b/test/cases/parsing/harmony-spec/index.js @@ -6,33 +6,33 @@ import cycleValue from "./export-cycle-a"; import { data } from "./self-cycle"; it("should establish live binding of values", function() { - value.should.be.eql(0); + expect(value).toBe(0); add(2); - value.should.be.eql(2); + expect(value).toBe(2); }); it("should establish live binding of values with transpiled es5 module", function() { - value2.should.be.eql(0); + expect(value2).toBe(0); add2(5); - value2.should.be.eql(5); + expect(value2).toBe(5); }); it("should allow to use eval with exports", function() { - valueEval.should.be.eql(0); + expect(valueEval).toBe(0); evalInModule("value = 5"); - valueEval.should.be.eql(5); + expect(valueEval).toBe(5); }); it("should execute modules in the correct order", function() { - getLog().should.be.eql(["a", "b", "c"]); + expect(getLog()).toEqual(["a", "b", "c"]); }); it("should bind exports before the module executes", function() { - cycleValue.should.be.eql(true); + expect(cycleValue).toBe(true); }); it("should allow to import live variables from itself", function() { - data.should.be.eql([undefined, 1, 2]); + expect(data).toEqual([undefined, 1, 2]); }); import { value as valueEval, evalInModule } from "./eval"; diff --git a/test/cases/parsing/harmony-tdz/index.js b/test/cases/parsing/harmony-tdz/index.js index a033014f0..de1543379 100644 --- a/test/cases/parsing/harmony-tdz/index.js +++ b/test/cases/parsing/harmony-tdz/index.js @@ -1,8 +1,8 @@ import value, { exception } from "./module"; it("should have a TDZ for exported const values", function() { - (typeof exception).should.be.eql("object"); + expect((typeof exception)).toBe("object"); exception.should.be.instanceof(Error); exception.message.should.match(/ is not defined$/); - value.should.be.eql("value"); + expect(value).toBe("value"); }); diff --git a/test/cases/parsing/harmony-this/index.js b/test/cases/parsing/harmony-this/index.js index 9a142de00..16eaa360e 100644 --- a/test/cases/parsing/harmony-this/index.js +++ b/test/cases/parsing/harmony-this/index.js @@ -7,11 +7,11 @@ import * as abc from "./abc"; function x() { throw new Error("should not be executed"); } it("should have this = undefined on imported non-strict functions", function() { x - d().should.be.eql("undefined"); + expect(d()).toBe("undefined"); x - a().should.be.eql("undefined"); + expect(a()).toBe("undefined"); x - B().should.be.eql("undefined"); + expect(B()).toBe("undefined"); }); import C2, { C } from "./new"; diff --git a/test/cases/parsing/harmony/index.js b/test/cases/parsing/harmony/index.js index 32117f23d..fbb63144b 100644 --- a/test/cases/parsing/harmony/index.js +++ b/test/cases/parsing/harmony/index.js @@ -26,62 +26,62 @@ import "unused"; it("should import a default export from a module", function() { - defaultExport.should.be.eql("def"); + expect(defaultExport).toBe("def"); }); it("should import an identifier from a module", function() { - a.should.be.eql("a"); - B.should.be.eql("b"); + expect(a).toBe("a"); + expect(B).toBe("b"); }); it("should import a whole module", function() { - abc.a.should.be.eql("a"); - abc.b.should.be.eql("b"); - abc.c.should.be.eql("c"); - abc.d.c.should.be.eql("c"); - abc.e.should.be.eql("c"); + expect(abc.a).toBe("a"); + expect(abc.b).toBe("b"); + expect(abc.c).toBe("c"); + expect(abc.d.c).toBe("c"); + expect(abc.e).toBe("c"); var copy = (function(a) { return a; }(abc)); - copy.a.should.be.eql("a"); - copy.b.should.be.eql("b"); - copy.c.should.be.eql("c"); - copy.d.c.should.be.eql("c"); - copy.e.should.be.eql("c"); - (typeof abc).should.be.eql("object"); + expect(copy.a).toBe("a"); + expect(copy.b).toBe("b"); + expect(copy.c).toBe("c"); + expect(copy.d.c).toBe("c"); + expect(copy.e).toBe("c"); + expect((typeof abc)).toBe("object"); }); it("should export functions", function() { fn.should.have.type("function"); - fn().should.be.eql("fn"); - (fn === fn).should.be.eql(true); + expect(fn()).toBe("fn"); + expect((fn === fn)).toBe(true); }); it("should multiple variables with one statement", function() { - one.should.be.eql("one"); - two.should.be.eql("two"); + expect(one).toBe("one"); + expect(two).toBe("two"); }); it("should still be able to use exported stuff", function() { - test1.should.be.eql("fn"); - test2.should.be.eql("two"); + expect(test1).toBe("fn"); + expect(test2).toBe("two"); }); it("should reexport a module", function() { - rea.should.be.eql("a"); - reb.should.be.eql("b"); - rec.should.be.eql("c"); - reo.should.be.eql("one"); - retwo.should.be.eql("two"); - rea2.should.be.eql("a"); + expect(rea).toBe("a"); + expect(reb).toBe("b"); + expect(rec).toBe("c"); + expect(reo).toBe("one"); + expect(retwo).toBe("two"); + expect(rea2).toBe("a"); }); it("should support circular dependencies", function() { - threeIsOdd.should.be.eql(true); - even(4).should.be.eql(true); + expect(threeIsOdd).toBe(true); + expect(even(4)).toBe(true); }); it("should support export specifier", function() { - specA.should.be.eql(1); - specB.should.be.eql(2); + expect(specA).toBe(1); + expect(specB).toBe(2); }); it("should be able to import commonjs", function() { @@ -90,25 +90,25 @@ it("should be able to import commonjs", function() { x Thing.should.have.type("function"); x - Thing().should.be.eql("thing"); + expect(Thing()).toBe("thing"); x - Other.should.be.eql("other"); + expect(Other).toBe("other"); Thing2.should.have.type("function"); - new Thing2().value.should.be.eql("thing"); - Other2.should.be.eql("other"); - Thing3().should.be.eql("thing"); + expect(new Thing2().value).toBe("thing"); + expect(Other2).toBe("other"); + expect(Thing3()).toBe("thing"); }); it("should be able to import commonjs with star import", function() { var copyOfCommonjs = commonjs; - commonjs().should.be.eql("thing"); - commonjs.Other.should.be.eql("other"); - copyOfCommonjs().should.be.eql("thing"); - copyOfCommonjs.Other.should.be.eql("other"); + expect(commonjs()).toBe("thing"); + expect(commonjs.Other).toBe("other"); + expect(copyOfCommonjs()).toBe("thing"); + expect(copyOfCommonjs.Other).toBe("other"); var copyOfCommonjsTrans = commonjsTrans; - new commonjsTrans.default().value.should.be.eql("thing"); - commonjsTrans.Other.should.be.eql("other"); - new copyOfCommonjsTrans.default().value.should.be.eql("thing"); - copyOfCommonjsTrans.Other.should.be.eql("other"); + expect(new commonjsTrans.default().value).toBe("thing"); + expect(commonjsTrans.Other).toBe("other"); + expect(new copyOfCommonjsTrans.default().value).toBe("thing"); + expect(copyOfCommonjsTrans.Other).toBe("other"); }); diff --git a/test/cases/parsing/inject-free-vars/index.js b/test/cases/parsing/inject-free-vars/index.js index 235dbb50f..043b3e4f3 100644 --- a/test/cases/parsing/inject-free-vars/index.js +++ b/test/cases/parsing/inject-free-vars/index.js @@ -1,18 +1,18 @@ it("should inject the module object into a chunk (AMD1)", function(done) { require([], function() { - module.webpackPolyfill.should.be.eql(1); + expect(module.webpackPolyfill).toBe(1); done(); }); }); it("should inject the module object into a chunk (AMD2)", function() { require([module.webpackPolyfill ? "./x1" : "./fail"]); - module.webpackPolyfill.should.be.eql(1); + expect(module.webpackPolyfill).toBe(1); }); it("should inject the module object into a chunk (ensure)", function(done) { require.ensure([], function(require) { - module.webpackPolyfill.should.be.eql(1); + expect(module.webpackPolyfill).toBe(1); done(); }); }); diff --git a/test/cases/parsing/issue-1600/index.js b/test/cases/parsing/issue-1600/index.js index 42d58a49c..bebd65238 100644 --- a/test/cases/parsing/issue-1600/index.js +++ b/test/cases/parsing/issue-1600/index.js @@ -1,5 +1,5 @@ import fn from './file'; it("should compile correctly", function() { - fn().should.be.eql(1); + expect(fn()).toBe(1); }); diff --git a/test/cases/parsing/issue-2019/index.js b/test/cases/parsing/issue-2019/index.js index 04c1ffaa7..186534811 100644 --- a/test/cases/parsing/issue-2019/index.js +++ b/test/cases/parsing/issue-2019/index.js @@ -1,4 +1,4 @@ it("should not fail on default export before export", function() { - require("./file").default.should.be.eql("default"); - require("./file").CONSTANT.should.be.eql("const"); -}); \ No newline at end of file + expect(require("./file").default).toBe("default"); + expect(require("./file").CONSTANT).toBe("const"); +}); diff --git a/test/cases/parsing/issue-2050/index.js b/test/cases/parsing/issue-2050/index.js index 85754b23b..640880bf3 100644 --- a/test/cases/parsing/issue-2050/index.js +++ b/test/cases/parsing/issue-2050/index.js @@ -1,5 +1,5 @@ it("should support multiple reexports", function() { - require("./x").should.be.eql({ + expect(require("./x")).toEqual({ xa: "a", xb: "b", xc: "c", diff --git a/test/cases/parsing/issue-2084/index.js b/test/cases/parsing/issue-2084/index.js index a9bc27f13..04383d5d6 100644 --- a/test/cases/parsing/issue-2084/index.js +++ b/test/cases/parsing/issue-2084/index.js @@ -7,8 +7,8 @@ it("should bind this context on require callback", function(done) { runWithThis({ok: true}, function() { require([], function() { try { - require("./file").should.be.eql("file"); - this.should.be.eql({ok: true}); + expect(require("./file")).toBe("file"); + expect(this).toEqual({ok: true}); done(); } catch(e) { done(e); } }.bind(this)); @@ -19,9 +19,9 @@ it("should bind this context on require callback (loaded)", function(done) { runWithThis({ok: true}, function() { require(["./load.js"], function(load) { try { - require("./file").should.be.eql("file"); - load.should.be.eql("load"); - this.should.be.eql({ok: true}); + expect(require("./file")).toBe("file"); + expect(load).toBe("load"); + expect(this).toEqual({ok: true}); done(); } catch(e) { done(e); } }.bind(this)); @@ -32,8 +32,8 @@ it("should bind this context on require callback (foo)", function(done) { var foo = {ok: true}; require([], function(load) { try { - require("./file").should.be.eql("file"); - this.should.be.eql({ok: true}); + expect(require("./file")).toBe("file"); + expect(this).toEqual({ok: true}); done(); } catch(e) { done(e); } }.bind(foo)); @@ -43,9 +43,9 @@ it("should bind this context on require callback (foo, loaded)", function(done) var foo = {ok: true}; require(["./load.js"], function(load) { try { - require("./file").should.be.eql("file"); - load.should.be.eql("load"); - this.should.be.eql({ok: true}); + expect(require("./file")).toBe("file"); + expect(load).toBe("load"); + expect(this).toEqual({ok: true}); done(); } catch(e) { done(e); } }.bind(foo)); @@ -55,8 +55,8 @@ it("should bind this context on require callback (foo)", function(done) { runWithThis({ok: true}, function() { require([], function(load) { try { - require("./file").should.be.eql("file"); - this.should.be.eql({ok: {ok: true}}); + expect(require("./file")).toBe("file"); + expect(this).toEqual({ok: {ok: true}}); done(); } catch(e) { done(e); } }.bind({ok: this})); @@ -67,8 +67,8 @@ it("should bind this context on require.ensure callback", function(done) { runWithThis({ok: true}, function() { require.ensure([], function(require) { try { - require("./file").should.be.eql("file"); - this.should.be.eql({ok: true}); + expect(require("./file")).toBe("file"); + expect(this).toEqual({ok: true}); done(); } catch(e) { done(e); } }.bind(this)); @@ -79,8 +79,8 @@ it("should bind this context on require.ensure callback (loaded)", function(done runWithThis({ok: true}, function() { require.ensure(["./load.js"], function(require) { try { - require("./file").should.be.eql("file"); - this.should.be.eql({ok: true}); + expect(require("./file")).toBe("file"); + expect(this).toEqual({ok: true}); done(); } catch(e) { done(e); } }.bind(this)); diff --git a/test/cases/parsing/issue-2349/index.js b/test/cases/parsing/issue-2349/index.js index 277cee408..065ececb5 100644 --- a/test/cases/parsing/issue-2349/index.js +++ b/test/cases/parsing/issue-2349/index.js @@ -1,5 +1,5 @@ import {x} from './a' // named imported cases an errors it("should be able to import a named export", function() { - x.should.be.eql(1); + expect(x).toBe(1); }); diff --git a/test/cases/parsing/issue-2522/index.js b/test/cases/parsing/issue-2522/index.js index 86cb81e38..7c13dad3e 100644 --- a/test/cases/parsing/issue-2522/index.js +++ b/test/cases/parsing/issue-2522/index.js @@ -9,7 +9,7 @@ it("should import into object shorthand", function() { b, c }; - o.should.be.eql({ + expect(o).toEqual({ a: 123, aa: 123, b: 456, @@ -18,4 +18,4 @@ it("should import into object shorthand", function() { default: 456 } }); -}) \ No newline at end of file +}) diff --git a/test/cases/parsing/issue-2523/index.js b/test/cases/parsing/issue-2523/index.js index 8adb8a17a..53c08cc14 100644 --- a/test/cases/parsing/issue-2523/index.js +++ b/test/cases/parsing/issue-2523/index.js @@ -3,7 +3,7 @@ import { B } from "./module"; import { c } from "./module"; it("should allow to export a class", function() { - (typeof A).should.be.eql("function"); - (typeof B).should.be.eql("function"); - c.should.be.eql("c"); -}) \ No newline at end of file + expect((typeof A)).toBe("function"); + expect((typeof B)).toBe("function"); + expect(c).toBe("c"); +}) diff --git a/test/cases/parsing/issue-2528/index.js b/test/cases/parsing/issue-2528/index.js index 8fa0cde76..a9a6562b8 100644 --- a/test/cases/parsing/issue-2528/index.js +++ b/test/cases/parsing/issue-2528/index.js @@ -51,7 +51,7 @@ import { count } from "./module"; it("should run async functions", function() { var org = count; notExportedAsync(); - count.should.be.eql(org + 1); + expect(count).toBe(org + 1); exportedAsync(); - count.should.be.eql(org + 2); + expect(count).toBe(org + 2); }); diff --git a/test/cases/parsing/issue-2570/index.js b/test/cases/parsing/issue-2570/index.js index 700e4eaa1..3339350df 100644 --- a/test/cases/parsing/issue-2570/index.js +++ b/test/cases/parsing/issue-2570/index.js @@ -6,8 +6,8 @@ it("should generate valid code when calling a harmony import function with brack var c = fn((3), (4)); var d = fn(5, (6)); - a.should.be.eql([1]); - b.should.be.eql([2]); - c.should.be.eql([3, 4]); - d.should.be.eql([5, 6]); + expect(a).toEqual([1]); + expect(b).toEqual([2]); + expect(c).toEqual([3, 4]); + expect(d).toEqual([5, 6]); }); diff --git a/test/cases/parsing/issue-2618/index.js b/test/cases/parsing/issue-2618/index.js index 1220384df..a8716a2f8 100644 --- a/test/cases/parsing/issue-2618/index.js +++ b/test/cases/parsing/issue-2618/index.js @@ -1,9 +1,9 @@ import defaultValue, { value, value2, value3, value4 } from "./module"; it("should be possible to redefine Object in a module", function() { - value.should.be.eql(123); - value2.should.be.eql(123); - value3.should.be.eql(123); - value4.should.be.eql(123); - defaultValue.should.be.eql(123); + expect(value).toBe(123); + expect(value2).toBe(123); + expect(value3).toBe(123); + expect(value4).toBe(123); + expect(defaultValue).toBe(123); }); diff --git a/test/cases/parsing/issue-2622/index.js b/test/cases/parsing/issue-2622/index.js index 262d5332e..696ecad76 100644 --- a/test/cases/parsing/issue-2622/index.js +++ b/test/cases/parsing/issue-2622/index.js @@ -9,8 +9,8 @@ var func2 = function(x = a, y = b) { } it("should import into default parameters", function() { - func().should.be.eql(["a", "b"]); - func2().should.be.eql(["a", "b"]); - func(1).should.be.eql([1, "b"]); - func2(2).should.be.eql([2, "b"]); + expect(func()).toEqual(["a", "b"]); + expect(func2()).toEqual(["a", "b"]); + expect(func(1)).toEqual([1, "b"]); + expect(func2(2)).toEqual([2, "b"]); }); diff --git a/test/cases/parsing/issue-2641/index.js b/test/cases/parsing/issue-2641/index.js index d2155f6d4..08f51da48 100644 --- a/test/cases/parsing/issue-2641/index.js +++ b/test/cases/parsing/issue-2641/index.js @@ -1,7 +1,7 @@ it("should require existing module with supplied error callback", function(done) { require(['./file'], function(file){ try { - file.should.be.eql("file"); + expect(file).toBe("file"); done(); } catch(e) { done(e); } }, function(error) { done(error); }); @@ -11,7 +11,7 @@ it("should call error callback on missing module", function(done) { require(['./file', './missingModule'], function(file){}, function(error) { try { error.should.be.instanceOf(Error); - error.message.should.be.eql('Cannot find module "./missingModule"'); + expect(error.message).toBe('Cannot find module "./missingModule"'); done(); } catch(e) { done(e); @@ -24,7 +24,7 @@ it("should call error callback on missing module in context", function(done) { require(['./' + module], function(file){}, function(error) { try { error.should.be.instanceOf(Error); - error.message.should.be.eql("Cannot find module \"./missingModule\"."); + expect(error.message).toBe("Cannot find module \"./missingModule\"."); done(); } catch(e) { done(e); } }); @@ -35,7 +35,7 @@ it("should call error callback on exception thrown in loading module", function( require(['./throwing'], function(){}, function(error) { try { error.should.be.instanceOf(Error); - error.message.should.be.eql('message'); + expect(error.message).toBe('message'); done(); } catch(e) { done(e); } }); @@ -47,7 +47,7 @@ it("should not call error callback on exception thrown in require callback", fun }, function(error) { try { error.should.be.instanceOf(Error); - error.message.should.be.eql('message'); + expect(error.message).toBe('message'); done(); } catch(e) { done(e); } }); diff --git a/test/cases/parsing/issue-2895/index.js b/test/cases/parsing/issue-2895/index.js index 26fba7279..83b1aae97 100644 --- a/test/cases/parsing/issue-2895/index.js +++ b/test/cases/parsing/issue-2895/index.js @@ -1,6 +1,6 @@ import { a, b } from "./a"; it("should export a const value without semicolon", function() { - a.should.be.eql({x: 1}); - b.should.be.eql({x: 2}); + expect(a).toEqual({x: 1}); + expect(b).toEqual({x: 2}); }); diff --git a/test/cases/parsing/issue-2942/index.js b/test/cases/parsing/issue-2942/index.js index f30332b6f..dfc72823a 100644 --- a/test/cases/parsing/issue-2942/index.js +++ b/test/cases/parsing/issue-2942/index.js @@ -2,11 +2,11 @@ it("should polyfill System", function() { if (typeof System === "object" && typeof System.register === "function") { require("fail"); } - (typeof System).should.be.eql("object"); - (typeof System.register).should.be.eql("undefined"); - (typeof System.get).should.be.eql("undefined"); - (typeof System.set).should.be.eql("undefined"); - (typeof System.anyNewItem).should.be.eql("undefined"); + expect((typeof System)).toBe("object"); + expect((typeof System.register)).toBe("undefined"); + expect((typeof System.get)).toBe("undefined"); + expect((typeof System.set)).toBe("undefined"); + expect((typeof System.anyNewItem)).toBe("undefined"); var x = System.anyNewItem; - (typeof x).should.be.eql("undefined"); + expect((typeof x)).toBe("undefined"); }) diff --git a/test/cases/parsing/issue-3116/index.js b/test/cases/parsing/issue-3116/index.js index c06f80824..5d7eb70d8 100644 --- a/test/cases/parsing/issue-3116/index.js +++ b/test/cases/parsing/issue-3116/index.js @@ -2,12 +2,12 @@ import * as file from "./file"; import * as file2 from "./file2"; it("should translate indexed access to harmony import correctly", function() { - file["default"].should.be.eql("default"); - file["abc"].should.be.eql("abc"); + expect(file["default"]).toBe("default"); + expect(file["abc"]).toBe("abc"); }); it("should translate dynamic indexed access to harmony import correctly", function() { var fault = "fault"; - file2["de" + fault].should.be.eql("default"); - file2["abc"].should.be.eql("abc"); + expect(file2["de" + fault]).toBe("default"); + expect(file2["abc"]).toBe("abc"); }); diff --git a/test/cases/parsing/issue-3273/index.js b/test/cases/parsing/issue-3273/index.js index 992223964..294ce89a9 100644 --- a/test/cases/parsing/issue-3273/index.js +++ b/test/cases/parsing/issue-3273/index.js @@ -2,37 +2,37 @@ import { test } from "./file"; it("should hide import by local var", function() { var test = "ok"; - test.should.be.eql("ok"); + expect(test).toBe("ok"); }); it("should hide import by object pattern", function() { var { test } = { test: "ok" }; - test.should.be.eql("ok"); + expect(test).toBe("ok"); }); it("should hide import by array pattern", function() { var [test] = ["ok"]; - test.should.be.eql("ok"); + expect(test).toBe("ok"); }); it("should hide import by array pattern (nested)", function() { var [[test]] = [["ok"]]; - test.should.be.eql("ok"); + expect(test).toBe("ok"); }); it("should hide import by pattern in function", function() { (function({test}) { - test.should.be.eql("ok"); + expect(test).toBe("ok"); }({ test: "ok" })); }); it("should allow import in default (incorrect)", function() { var { other = test, test } = { test: "ok" }; - test.should.be.eql("ok"); - (typeof other).should.be.eql("undefined"); + expect(test).toBe("ok"); + expect((typeof other)).toBe("undefined"); }); it("should allow import in default", function() { var { other = test } = { test: "ok" }; - other.should.be.eql("test"); + expect(other).toBe("test"); }); diff --git a/test/cases/parsing/issue-345/index.js b/test/cases/parsing/issue-345/index.js index 9dc72a8a6..00f1b5fc6 100644 --- a/test/cases/parsing/issue-345/index.js +++ b/test/cases/parsing/issue-345/index.js @@ -1,7 +1,7 @@ it("should parse multiple expressions in a require", function(done) { var name = "abc"; require(["./" + name + "/" + name + "Test"], function(x) { - x.should.be.eql("ok"); + expect(x).toBe("ok"); done(); }); -}); \ No newline at end of file +}); diff --git a/test/cases/parsing/issue-3769/index.js b/test/cases/parsing/issue-3769/index.js index 85d022ca5..393ea08ae 100644 --- a/test/cases/parsing/issue-3769/index.js +++ b/test/cases/parsing/issue-3769/index.js @@ -1,3 +1,3 @@ it("should generate valid code", function() { - require("./module").myTest.should.be.eql("test"); + expect(require("./module").myTest).toBe("test"); }); diff --git a/test/cases/parsing/issue-387/index.js b/test/cases/parsing/issue-387/index.js index 60b2a8c50..f0fd266e4 100644 --- a/test/cases/parsing/issue-387/index.js +++ b/test/cases/parsing/issue-387/index.js @@ -10,7 +10,7 @@ it("should parse cujojs UMD modules", function() { ? define : function (factory) { module.exports = factory(require); } )); - module.exports.should.be.eql(123); + expect(module.exports).toBe(123); }); it("should parse cujojs UMD modules with deps", function() { @@ -30,7 +30,7 @@ it("should parse cujojs UMD modules with deps", function() { module.exports = factory.apply(null, deps); } )); - module.exports.should.be.eql(1234); + expect(module.exports).toBe(1234); }); it("should parse cujojs UMD modules with inlinded deps", function() { @@ -45,5 +45,5 @@ it("should parse cujojs UMD modules with inlinded deps", function() { ? define : function (factory) { module.exports = factory(require); } )); - module.exports.should.be.eql(4321); -}); \ No newline at end of file + expect(module.exports).toBe(4321); +}); diff --git a/test/cases/parsing/issue-3917/index.js b/test/cases/parsing/issue-3917/index.js index 119e28bed..a59847007 100644 --- a/test/cases/parsing/issue-3917/index.js +++ b/test/cases/parsing/issue-3917/index.js @@ -8,7 +8,7 @@ it("should not find a free exports", function() { if(typeof exports !== "undefined") (x.default).should.be.equal(exports); else - (x.default).should.be.eql(false); + expect((x.default)).toBe(false); }); export {} diff --git a/test/cases/parsing/issue-3964/index.js b/test/cases/parsing/issue-3964/index.js index f290a7fa9..90dd22f7c 100644 --- a/test/cases/parsing/issue-3964/index.js +++ b/test/cases/parsing/issue-3964/index.js @@ -1,4 +1,4 @@ it("should be possible to export default an imported name", function() { var x = require("./module"); - x.should.be.eql({ default: 1234 }); + expect(x).toEqual({ default: 1234 }); }); diff --git a/test/cases/parsing/issue-4179/index.js b/test/cases/parsing/issue-4179/index.js index 9a769bf3d..c3e7c95a7 100644 --- a/test/cases/parsing/issue-4179/index.js +++ b/test/cases/parsing/issue-4179/index.js @@ -2,7 +2,7 @@ import def from "./module?harmony"; import * as mod from "./module?harmony-start" it("should export a sequence expression correctly", function() { - require("./module?cjs").should.be.eql({ default: 2 }); - def.should.be.eql(2); - mod.default.should.be.eql(2); + expect(require("./module?cjs")).toEqual({ default: 2 }); + expect(def).toBe(2); + expect(mod.default).toBe(2); }); diff --git a/test/cases/parsing/issue-4357/index.js b/test/cases/parsing/issue-4357/index.js index 2b3f1da86..bef054d11 100644 --- a/test/cases/parsing/issue-4357/index.js +++ b/test/cases/parsing/issue-4357/index.js @@ -5,7 +5,7 @@ it("should parse dynamic property names", function() { [require("./a")]: "a", [b]: "b" }; - o.should.be.eql({ + expect(o).toEqual({ a: "a", b: "b" }); @@ -21,7 +21,7 @@ it("should match dynamic property names", function() { [b]: cc } }]] = [0, 1, {b: {b: "c"}}]; - aa.should.be.eql("a"); - bb.should.be.eql("b"); - cc.should.be.eql("c"); + expect(aa).toBe("a"); + expect(bb).toBe("b"); + expect(cc).toBe("c"); }); diff --git a/test/cases/parsing/issue-4608-1/index.js b/test/cases/parsing/issue-4608-1/index.js index 5ac3cf4b6..760ccdba7 100644 --- a/test/cases/parsing/issue-4608-1/index.js +++ b/test/cases/parsing/issue-4608-1/index.js @@ -1,5 +1,5 @@ it("should find var declaration later in code", function() { - (typeof require).should.be.eql("undefined"); + expect((typeof require)).toBe("undefined"); var require; }); @@ -10,7 +10,7 @@ it("should find var declaration in same statement", function() { }), require; require = (function(x) { - x.should.be.eql("fail"); + expect(x).toBe("fail"); }); fn(); }); @@ -18,7 +18,7 @@ it("should find var declaration in same statement", function() { it("should find a catch block declaration", function() { try { var f = (function(x) { - x.should.be.eql("fail"); + expect(x).toBe("fail"); }); throw f; } catch(require) { @@ -28,7 +28,7 @@ it("should find a catch block declaration", function() { it("should find var declaration in control statements", function() { var f = (function(x) { - x.should.be.eql("fail"); + expect(x).toBe("fail"); }); (function() { @@ -83,7 +83,7 @@ it("should find var declaration in control statements", function() { it("should find var declaration in control statements after usage", function() { var f = (function(x) { - x.should.be.eql("fail"); + expect(x).toBe("fail"); }); (function() { diff --git a/test/cases/parsing/issue-4608-2/index.js b/test/cases/parsing/issue-4608-2/index.js index 4aea99e05..f2e777a5d 100644 --- a/test/cases/parsing/issue-4608-2/index.js +++ b/test/cases/parsing/issue-4608-2/index.js @@ -2,7 +2,7 @@ it("should find var declaration in control statements", function() { var f = (function(x) { - x.should.be.eql("fail"); + expect(x).toBe("fail"); }); (function() { @@ -16,7 +16,7 @@ it("should find var declaration in control statements", function() { it("should find var declaration in control statements after usage", function() { var f = (function(x) { - x.should.be.eql("fail"); + expect(x).toBe("fail"); }); (function() { diff --git a/test/cases/parsing/issue-4870/index.js b/test/cases/parsing/issue-4870/index.js index 81774bc88..2e1700560 100644 --- a/test/cases/parsing/issue-4870/index.js +++ b/test/cases/parsing/issue-4870/index.js @@ -3,11 +3,11 @@ import { test } from "./file"; it("should allow import in array destructing", function() { var other; [other = test] = []; - other.should.be.eql("test"); + expect(other).toBe("test"); }); it("should allow import in object destructing", function() { var other; ({other = test} = {}); - other.should.be.eql("test"); + expect(other).toBe("test"); }); diff --git a/test/cases/parsing/issue-551/index.js b/test/cases/parsing/issue-551/index.js index 6f3a39a0f..16d3208d2 100644 --- a/test/cases/parsing/issue-551/index.js +++ b/test/cases/parsing/issue-551/index.js @@ -5,20 +5,20 @@ it("should be able to set the public path", function() { global.xyz = "xyz"; __webpack_public_path__ = global.xyz; - __webpack_require__.p.should.be.eql("xyz"); + expect(__webpack_require__.p).toBe("xyz"); delete global.xyz; window.something = "something"; __webpack_public_path__ = window.something; - __webpack_require__.p.should.be.eql("something"); + expect(__webpack_require__.p).toBe("something"); delete window.something; __webpack_public_path__ = "abc"; - __webpack_require__.p.should.be.eql("abc"); + expect(__webpack_require__.p).toBe("abc"); __webpack_public_path__ = func(); - __webpack_require__.p.should.be.eql("func"); - + expect(__webpack_require__.p).toBe("func"); + __webpack_public_path__ = originalValue; function func() { diff --git a/test/cases/parsing/issue-5624/index.js b/test/cases/parsing/issue-5624/index.js index affa367d8..b230381ff 100644 --- a/test/cases/parsing/issue-5624/index.js +++ b/test/cases/parsing/issue-5624/index.js @@ -2,5 +2,5 @@ import { fn } from "./module"; it("should allow conditionals as callee", function() { var x = (true ? fn : fn)(); - x.should.be.eql("ok"); + expect(x).toBe("ok"); }); diff --git a/test/cases/parsing/issue-758/index.js b/test/cases/parsing/issue-758/index.js index bcae179ba..9646436d5 100644 --- a/test/cases/parsing/issue-758/index.js +++ b/test/cases/parsing/issue-758/index.js @@ -2,7 +2,7 @@ it("should require existing module with supplied error callback", function(done) require.ensure(['./file'], function(){ try { var file = require('./file'); - file.should.be.eql("file"); + expect(file).toBe("file"); done(); } catch(e) { done(e); } }, function(error) {}); @@ -13,7 +13,7 @@ it("should call error callback on missing module", function(done) { require('./missingModule'); }, function(error) { error.should.be.instanceOf(Error); - error.message.should.be.eql('Cannot find module "./missingModule"'); + expect(error.message).toBe('Cannot find module "./missingModule"'); done(); }); }); @@ -24,7 +24,7 @@ it("should call error callback on missing module in context", function(done) { require('./' + module); }, function(error) { error.should.be.instanceOf(Error); - error.message.should.be.eql("Cannot find module \"./missingModule\"."); + expect(error.message).toBe("Cannot find module \"./missingModule\"."); done(); }); })('missingModule'); @@ -35,7 +35,7 @@ it("should call error callback on exception thrown in loading module", function( require('./throwing'); }, function(error) { error.should.be.instanceOf(Error); - error.message.should.be.eql('message'); + expect(error.message).toBe('message'); done(); }); }); @@ -45,7 +45,7 @@ it("should not call error callback on exception thrown in require callback", fun throw new Error('message'); }, function(error) { error.should.be.instanceOf(Error); - error.message.should.be.eql('message'); + expect(error.message).toBe('message'); done(); }); }); @@ -58,7 +58,7 @@ it("should call error callback when there is an error loading the chunk", functi var file = require('./file'); } catch(e) { done(e); } }, function(error) { - error.should.be.eql('fake chunk load error'); + expect(error).toBe('fake chunk load error'); done(); }); __webpack_require__.e = temp; diff --git a/test/cases/parsing/local-modules/index.js b/test/cases/parsing/local-modules/index.js index 1d558cc85..8eae3c396 100644 --- a/test/cases/parsing/local-modules/index.js +++ b/test/cases/parsing/local-modules/index.js @@ -3,13 +3,13 @@ it("should define and require a local module", function() { define("my-module", function() { return 1234; }); - module.exports.should.be.eql("not set"); + expect(module.exports).toBe("not set"); define(["my-module"], function(myModule) { - myModule.should.be.eql(1234); + expect(myModule).toBe(1234); return 2345; }); - module.exports.should.be.eql(2345); - require("my-module").should.be.eql(1234); + expect(module.exports).toBe(2345); + expect(require("my-module")).toBe(1234); require(["my-module"]); }); @@ -19,11 +19,11 @@ it("should not create a chunk for a AMD require to a local module", function(don }); var sync = false; require(["my-module2"], function(myModule2) { - myModule2.should.be.eql(1235); + expect(myModule2).toBe(1235); sync = true; }); setImmediate(function() { - sync.should.be.eql(true); + expect(sync).toBe(true); done(); }); }); @@ -31,18 +31,18 @@ it("should not create a chunk for a AMD require to a local module", function(don it("should define and require a local module with deps", function() { module.exports = "not set"; define("my-module3", ["./dep"], function(dep) { - dep.should.be.eql("dep"); + expect(dep).toBe("dep"); return 1234; }); - module.exports.should.be.eql("not set"); + expect(module.exports).toBe("not set"); define("my-module4", ["my-module3", "./dep"], function(myModule, dep) { - dep.should.be.eql("dep"); - myModule.should.be.eql(1234); + expect(dep).toBe("dep"); + expect(myModule).toBe(1234); return 2345; }); - module.exports.should.be.eql("not set"); - require("my-module3").should.be.eql(1234); - require("my-module4").should.be.eql(2345); + expect(module.exports).toBe("not set"); + expect(require("my-module3")).toBe(1234); + expect(require("my-module4")).toBe(2345); }); it("should define and require a local module that is relative", function () { @@ -53,9 +53,9 @@ it("should define and require a local module that is relative", function () { return 2345; }); define("my-dir/my-other-dir/my-module5", ["./my-module4", "../my-module3"], function(myModule4, myModule3) { - myModule3.should.be.eql(1234); - myModule4.should.be.eql(2345); + expect(myModule3).toBe(1234); + expect(myModule4).toBe(2345); return 3456; }); - require("my-dir/my-other-dir/my-module5").should.be.eql(3456); + expect(require("my-dir/my-other-dir/my-module5")).toBe(3456); }) diff --git a/test/cases/parsing/pattern-in-for/index.js b/test/cases/parsing/pattern-in-for/index.js index 85786e65e..499af551c 100644 --- a/test/cases/parsing/pattern-in-for/index.js +++ b/test/cases/parsing/pattern-in-for/index.js @@ -1,15 +1,15 @@ it("should parse patterns in for in/of statements", () => { var message; for({ message = require("./module")} of [{}]) { - message.should.be.eql("ok"); + expect(message).toBe("ok"); } for({ message = require("./module") } in { "string": "value" }) { - message.should.be.eql("ok"); + expect(message).toBe("ok"); } for(var { value = require("./module")} of [{}]) { - value.should.be.eql("ok"); + expect(value).toBe("ok"); } for(var { value = require("./module") } in { "string": "value" }) { - value.should.be.eql("ok"); + expect(value).toBe("ok"); } }); diff --git a/test/cases/parsing/precreated-ast/index.js b/test/cases/parsing/precreated-ast/index.js index dbcba8820..a74dea11d 100644 --- a/test/cases/parsing/precreated-ast/index.js +++ b/test/cases/parsing/precreated-ast/index.js @@ -1,3 +1,3 @@ it("should be able to process AST from loader", function() { - require("./ast-loader!./module").should.be.eql("ok"); + expect(require("./ast-loader!./module")).toBe("ok"); }); diff --git a/test/cases/parsing/renaming/index.js b/test/cases/parsing/renaming/index.js index 22e0edde9..fea96df25 100644 --- a/test/cases/parsing/renaming/index.js +++ b/test/cases/parsing/renaming/index.js @@ -1,8 +1,8 @@ it("should be able to rename require by var", function() { var cjsRequire; // just to make it difficult var cjsRequire = require, cjsRequire2 = typeof require !== "undefined" && require; - cjsRequire("./file").should.be.eql("ok"); - cjsRequire2("./file").should.be.eql("ok"); + expect(cjsRequire("./file")).toBe("ok"); + expect(cjsRequire2("./file")).toBe("ok"); }); it("should be able to rename require by assign", function() { @@ -10,39 +10,39 @@ it("should be able to rename require by assign", function() { (function() { cjsRequire = require; cjsRequire2 = typeof require === "function" && require; - cjsRequire("./file").should.be.eql("ok"); - cjsRequire2("./file").should.be.eql("ok"); + expect(cjsRequire("./file")).toBe("ok"); + expect(cjsRequire2("./file")).toBe("ok"); }()); }); it("should be able to rename require by IIFE", function() { (function(cjsRequire) { - cjsRequire("./file").should.be.eql("ok"); + expect(cjsRequire("./file")).toBe("ok"); }(require)); }); it("should be able to rename require by IIFE call", function() { (function(somethingElse, cjsRequire) { - cjsRequire("./file").should.be.eql("ok"); - somethingElse.should.be.eql(123); + expect(cjsRequire("./file")).toBe("ok"); + expect(somethingElse).toBe(123); }.call(this, 123, typeof require === "function" ? require : "error")); }); it("should be able to rename stuff by IIFE call", function() { (function(_exports, _exports2, _module, _module2, _define, _define2, _require, _require2) { _define(function(R, E, M) { - R("./file").should.be.eql("ok"); - _require("./file").should.be.eql("ok"); - _require2("./file").should.be.eql("ok"); - E.should.be.eql(exports); - _exports.should.be.eql(exports); - _exports2.should.be.eql(exports); - M.should.be.eql(module); - _module.should.be.eql(module); - _module2.should.be.eql(module); + expect(R("./file")).toBe("ok"); + expect(_require("./file")).toBe("ok"); + expect(_require2("./file")).toBe("ok"); + expect(E).toBe(exports); + expect(_exports).toBe(exports); + expect(_exports2).toBe(exports); + expect(M).toBe(module); + expect(_module).toBe(module); + expect(_module2).toBe(module); }); _define2(["./file"], function(file) { - file.should.be.eql("ok"); + expect(file).toBe("ok"); }); }).call(this, typeof exports !== 'undefined' ? exports : null, @@ -57,8 +57,8 @@ it("should be able to rename stuff by IIFE call", function() { it("should accept less parameters in a IIFE call", function() { (function(r, require) { - r("./file").should.be.eql("ok"); - (typeof require).should.be.eql("undefined"); + expect(r("./file")).toBe("ok"); + expect((typeof require)).toBe("undefined"); }(require)); }); @@ -70,12 +70,12 @@ it("should accept more parameters in a IIFE call", function() { it("should be able to rename stuff by IIFE call", function() { (function(_exports, _module, _define, _require) { _define(function(R, E, M) { - R("./file").should.be.eql("ok"); - _require("./file").should.be.eql("ok"); - E.should.be.eql(exports); - _exports.should.be.eql(exports); - M.should.be.eql(module); - _module.should.be.eql(module); + expect(R("./file")).toBe("ok"); + expect(_require("./file")).toBe("ok"); + expect(E).toBe(exports); + expect(_exports).toBe(exports); + expect(M).toBe(module); + expect(_module).toBe(module); }); }).call(this, typeof exports !== 'undefined' ? exports : null, diff --git a/test/cases/parsing/requirejs/index.js b/test/cases/parsing/requirejs/index.js index 37ea0ef2f..84b023395 100644 --- a/test/cases/parsing/requirejs/index.js +++ b/test/cases/parsing/requirejs/index.js @@ -14,7 +14,7 @@ it("should have a requirejs.onError function", function() { requirejs.onError.should.be.type("function"); // has default handler var org = requirejs.onError; requirejs.onError = f; - requirejs.onError.should.be.eql(f); + expect(requirejs.onError).toBe(f); requirejs.onError = org; require(["./file.js"], function() {}); }); diff --git a/test/cases/parsing/resolve-weak-context/index.js b/test/cases/parsing/resolve-weak-context/index.js index d166968e0..735c7fa49 100644 --- a/test/cases/parsing/resolve-weak-context/index.js +++ b/test/cases/parsing/resolve-weak-context/index.js @@ -1,6 +1,6 @@ it("should be able to use require.resolveWeak with expression", function() { var expr = "file"; var id = require.resolveWeak("./dir/" + expr); - id.should.be.eql(require("./dir/file.js")); + expect(id).toBe(require("./dir/file.js")); }); diff --git a/test/cases/parsing/strict-mode/index.js b/test/cases/parsing/strict-mode/index.js index 47aaab0da..d3e026f57 100644 --- a/test/cases/parsing/strict-mode/index.js +++ b/test/cases/parsing/strict-mode/index.js @@ -9,11 +9,11 @@ define(["./abc"], function(abc) { var x = (function() { return this; })(); - (typeof x).should.be.eql("undefined"); + expect((typeof x)).toBe("undefined"); }); it("should import modules in strict mode", function() { - a().should.be.eql("undefined"); + expect(a()).toBe("undefined"); }); -}); \ No newline at end of file +}); diff --git a/test/cases/parsing/typeof/index.js b/test/cases/parsing/typeof/index.js index 0425079e7..93e366595 100644 --- a/test/cases/parsing/typeof/index.js +++ b/test/cases/parsing/typeof/index.js @@ -1,33 +1,33 @@ it("should not create a context for typeof require", function() { - require("./typeof").should.be.eql("function"); + expect(require("./typeof")).toBe("function"); }); it("should answer typeof require correctly", function() { - (typeof require).should.be.eql("function"); + expect((typeof require)).toBe("function"); }); it("should answer typeof define correctly", function() { - (typeof define).should.be.eql("function"); + expect((typeof define)).toBe("function"); }); it("should answer typeof require.amd correctly", function() { - (typeof require.amd).should.be.eql("object"); + expect((typeof require.amd)).toBe("object"); }); it("should answer typeof define.amd correctly", function() { - (typeof define.amd).should.be.eql("object"); + expect((typeof define.amd)).toBe("object"); }); it("should answer typeof module correctly", function() { - (typeof module).should.be.eql("object"); + expect((typeof module)).toBe("object"); }); it("should answer typeof exports correctly", function() { - (typeof exports).should.be.eql("object"); + expect((typeof exports)).toBe("object"); }); it("should answer typeof require.include correctly", function() { - (typeof require.include).should.be.eql("function"); + expect((typeof require.include)).toBe("function"); }); it("should answer typeof require.ensure correctly", function() { - (typeof require.ensure).should.be.eql("function"); + expect((typeof require.ensure)).toBe("function"); }); it("should answer typeof require.resolve correctly", function() { - (typeof require.resolve).should.be.eql("function"); + expect((typeof require.resolve)).toBe("function"); }); it("should not parse filtered stuff", function() { diff --git a/test/cases/parsing/var-hiding/index.js b/test/cases/parsing/var-hiding/index.js index c339dee9e..095807df0 100644 --- a/test/cases/parsing/var-hiding/index.js +++ b/test/cases/parsing/var-hiding/index.js @@ -2,9 +2,9 @@ var fn = function(module) { if (typeof module !== 'number') { throw new Error("module should be a number"); } - (typeof module).should.be.eql("number"); + expect((typeof module)).toBe("number"); }; it("should hide a free var by function argument", function() { fn(1); -}); \ No newline at end of file +}); diff --git a/test/cases/resolving/browser-field/index.js b/test/cases/resolving/browser-field/index.js index 342938206..4fc076874 100644 --- a/test/cases/resolving/browser-field/index.js +++ b/test/cases/resolving/browser-field/index.js @@ -1,36 +1,36 @@ it("should replace a module with a module", function() { - require("replacing-module1").should.be.eql("new-module"); + expect(require("replacing-module1")).toBe("new-module"); }); it("should replace a module with a file in a module", function() { - require("replacing-module2").should.be.eql("new-module/inner"); + expect(require("replacing-module2")).toBe("new-module/inner"); }); it("should replace a module with file in the same module", function() { - require("replacing-module3").should.be.eql("new-module/inner"); + expect(require("replacing-module3")).toBe("new-module/inner"); }); it("should replace a module with a file in the current module", function() { - require("replacing-module4").should.be.eql("replacing-module4/module"); + expect(require("replacing-module4")).toBe("replacing-module4/module"); }); it("should replace a file with another file", function() { - require("replacing-file1").should.be.eql("new-file"); + expect(require("replacing-file1")).toBe("new-file"); }); it("should replace a file with a module", function() { - require("replacing-file2").should.be.eql("new-module"); + expect(require("replacing-file2")).toBe("new-module"); }); it("should replace a file with a file in a module", function() { - require("replacing-file3").should.be.eql("new-module/inner"); + expect(require("replacing-file3")).toBe("new-module/inner"); }); it("should replace a file in a directory with another file", function() { - require("replacing-file4").should.be.eql("new-file"); + expect(require("replacing-file4")).toBe("new-file"); }); it("should ignore recursive module mappings", function() { - require("recursive-module").should.be.eql("new-module"); + expect(require("recursive-module")).toBe("new-module"); }); it("should use empty modules for ignored modules", function() { - require("ignoring-module").module.should.be.eql({}); - require("ignoring-module").file.should.be.eql({}); + expect(require("ignoring-module").module).toEqual({}); + expect(require("ignoring-module").file).toEqual({}); require("ignoring-module").module.should.not.be.equal(require("ignoring-module").file); }); diff --git a/test/cases/resolving/context/index.js b/test/cases/resolving/context/index.js index 0b4e1b9a6..89c944dc6 100644 --- a/test/cases/resolving/context/index.js +++ b/test/cases/resolving/context/index.js @@ -1,11 +1,11 @@ it("should resolve loaders relative to require", function() { var index = "index", test = "test"; - require("./loaders/queryloader?query!!!!./node_modules/subcontent/" + index + ".js").should.be.eql({ + expect(require("./loaders/queryloader?query!!!!./node_modules/subcontent/" + index + ".js")).toEqual({ resourceQuery: "", query: "?query", prev: "module.exports = \"error\";" }); - require("!./loaders/queryloader?query!./node_modules/subcontent/" + test + ".jade").should.be.eql({ + expect(require("!./loaders/queryloader?query!./node_modules/subcontent/" + test + ".jade")).toEqual({ resourceQuery: "", query: "?query", prev: "xyz: abc" diff --git a/test/cases/resolving/single-file-module/index.js b/test/cases/resolving/single-file-module/index.js index fed4edbdd..62fffa34f 100644 --- a/test/cases/resolving/single-file-module/index.js +++ b/test/cases/resolving/single-file-module/index.js @@ -1,3 +1,3 @@ it("should load single file modules", function() { - require("subfilemodule").should.be.eql("subfilemodule"); + expect(require("subfilemodule")).toBe("subfilemodule"); }); diff --git a/test/cases/runtime/chunk-callback-order/duplicate.js b/test/cases/runtime/chunk-callback-order/duplicate.js index 9867c8106..354829318 100644 --- a/test/cases/runtime/chunk-callback-order/duplicate.js +++ b/test/cases/runtime/chunk-callback-order/duplicate.js @@ -1,3 +1,3 @@ require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); -}) \ No newline at end of file + expect(require("./a")).toBe("a"); +}) diff --git a/test/cases/runtime/chunk-callback-order/duplicate2.js b/test/cases/runtime/chunk-callback-order/duplicate2.js index e6ab3c768..37b0f6b4d 100644 --- a/test/cases/runtime/chunk-callback-order/duplicate2.js +++ b/test/cases/runtime/chunk-callback-order/duplicate2.js @@ -1,3 +1,3 @@ require.ensure(["./b"], function(require) { - require("./b").should.be.eql("a"); -}) \ No newline at end of file + expect(require("./b")).toBe("a"); +}) diff --git a/test/cases/runtime/chunk-callback-order/index.js b/test/cases/runtime/chunk-callback-order/index.js index 3a3f2466a..bed75d0dd 100644 --- a/test/cases/runtime/chunk-callback-order/index.js +++ b/test/cases/runtime/chunk-callback-order/index.js @@ -9,7 +9,7 @@ it("should fire multiple code load callbacks in the correct order", function(don require("./duplicate"); require("./duplicate2"); calls.push(2); - calls.should.be.eql([1,2]); + expect(calls).toEqual([1,2]); done(); }); }); diff --git a/test/cases/runtime/circular-dependencies/index.js b/test/cases/runtime/circular-dependencies/index.js index 5a7df2b4c..fe6664245 100644 --- a/test/cases/runtime/circular-dependencies/index.js +++ b/test/cases/runtime/circular-dependencies/index.js @@ -1,3 +1,3 @@ it("should load circular dependencies correctly", function() { - require("./circular").should.be.eql(1); + expect(require("./circular")).toBe(1); }); diff --git a/test/cases/runtime/error-handling/index.js b/test/cases/runtime/error-handling/index.js index a8652210c..35ab87145 100644 --- a/test/cases/runtime/error-handling/index.js +++ b/test/cases/runtime/error-handling/index.js @@ -1,11 +1,11 @@ function testCase(number) { - require(number === 1 ? "./folder/file1" : number === 2 ? "./folder/file2" : number === 3 ? "./folder/file3" : "./missingModule").should.be.eql("file" + number); + expect(require(number === 1 ? "./folder/file1" : number === 2 ? "./folder/file2" : number === 3 ? "./folder/file3" : "./missingModule")).toBe("file" + number); require( number === 1 ? "./folder/file1" : number === 2 ? "./folder/file2" : number === 3 ? "./folder/file3" : "./missingModule" - ).should.be.eql("file" + number); + expect()).toBe("file" + number); } diff --git a/test/cases/runtime/issue-1650/index.js b/test/cases/runtime/issue-1650/index.js index 307fc665d..f14a6b661 100644 --- a/test/cases/runtime/issue-1650/index.js +++ b/test/cases/runtime/issue-1650/index.js @@ -1,6 +1,6 @@ it("should be able to set the public path globally", function() { var org = __webpack_public_path__; require("./file"); - __webpack_public_path__.should.be.eql("ok"); + expect(__webpack_public_path__).toBe("ok"); __webpack_public_path__ = org; }); diff --git a/test/cases/runtime/issue-1788/a.js b/test/cases/runtime/issue-1788/a.js index a15f19f71..f61f5ca91 100644 --- a/test/cases/runtime/issue-1788/a.js +++ b/test/cases/runtime/issue-1788/a.js @@ -3,5 +3,5 @@ export default 'a-default'; export { btest } from "./b"; export function atest() { - b.should.be.eql("b-default"); + expect(b).toBe("b-default"); } diff --git a/test/cases/runtime/issue-1788/b.js b/test/cases/runtime/issue-1788/b.js index d79b5e301..999009add 100644 --- a/test/cases/runtime/issue-1788/b.js +++ b/test/cases/runtime/issue-1788/b.js @@ -2,5 +2,5 @@ import a from './a'; export default 'b-default'; export function btest() { - a.should.be.eql("a-default"); + expect(a).toBe("a-default"); } diff --git a/test/cases/runtime/issue-2391-chunk/index.js b/test/cases/runtime/issue-2391-chunk/index.js index d11248e9e..7e38eadbd 100644 --- a/test/cases/runtime/issue-2391-chunk/index.js +++ b/test/cases/runtime/issue-2391-chunk/index.js @@ -1,4 +1,4 @@ it("should have a require.onError function by default", function() { - (typeof require.onError).should.be.eql("function"); + expect((typeof require.onError)).toBe("function"); require(["./file"]); -}); \ No newline at end of file +}); diff --git a/test/cases/runtime/issue-2391/index.js b/test/cases/runtime/issue-2391/index.js index c2ef272b6..c01b3c35a 100644 --- a/test/cases/runtime/issue-2391/index.js +++ b/test/cases/runtime/issue-2391/index.js @@ -1,3 +1,3 @@ it("should not have a require.onError function by default", function() { - (typeof require.onError).should.be.eql("undefined"); // expected to fail in browsertests -}); \ No newline at end of file + expect((typeof require.onError)).toBe("undefined"); // expected to fail in browsertests +}); diff --git a/test/cases/runtime/missing-module-exception/index.js b/test/cases/runtime/missing-module-exception/index.js index fa2d10d63..3351fb7a5 100644 --- a/test/cases/runtime/missing-module-exception/index.js +++ b/test/cases/runtime/missing-module-exception/index.js @@ -2,6 +2,6 @@ it("should have correct error code", function() { try { require("./fail"); } catch(e) { - e.code.should.be.eql("MODULE_NOT_FOUND"); + expect(e.code).toBe("MODULE_NOT_FOUND"); } -}); \ No newline at end of file +}); diff --git a/test/cases/runtime/module-caching/index.js b/test/cases/runtime/module-caching/index.js index 7846b43b5..a8923918f 100644 --- a/test/cases/runtime/module-caching/index.js +++ b/test/cases/runtime/module-caching/index.js @@ -2,12 +2,12 @@ var should = require("should"); it("should cache modules correctly", function(done) { delete require.cache[require.resolve("./singluar.js")]; - require("./singluar.js").value.should.be.eql(1); - (require("./singluar.js")).value.should.be.eql(1); + expect(require("./singluar.js").value).toBe(1); + expect((require("./singluar.js")).value).toBe(1); require("./sing" + "luar.js").value = 2; - require("./singluar.js").value.should.be.eql(2); + expect(require("./singluar.js").value).toBe(2); require.ensure(["./two.js"], function(require) { - require("./singluar.js").value.should.be.eql(2); + expect(require("./singluar.js").value).toBe(2); done(); }); }); @@ -18,7 +18,7 @@ it("should be able the remove modules from cache with require.cache and require. var singlarIdInConditional = require.resolve(true ? "./singluar2" : "./singluar"); if(typeof singlarId !== "number" && typeof singlarId !== "string") throw new Error("require.resolve should return a number or string"); - singlarIdInConditional.should.be.eql(singlarId); + expect(singlarIdInConditional).toBe(singlarId); (require.cache).should.have.type("object"); (require.cache[singlarId]).should.have.type("object"); delete require.cache[singlarId]; diff --git a/test/cases/scope-hoisting/async-keyword-5615/index.js b/test/cases/scope-hoisting/async-keyword-5615/index.js index b2e73311b..845e64bd5 100644 --- a/test/cases/scope-hoisting/async-keyword-5615/index.js +++ b/test/cases/scope-hoisting/async-keyword-5615/index.js @@ -1,5 +1,5 @@ import value from "./async"; it("should have the correct values", function() { - value.should.be.eql("default"); + expect(value).toBe("default"); }); diff --git a/test/cases/scope-hoisting/chained-reexport/index.js b/test/cases/scope-hoisting/chained-reexport/index.js index 5ac21327b..bfc180c27 100644 --- a/test/cases/scope-hoisting/chained-reexport/index.js +++ b/test/cases/scope-hoisting/chained-reexport/index.js @@ -1,5 +1,5 @@ import { named } from "./c"; it("should have the correct values", function() { - named.should.be.eql("named"); + expect(named).toBe("named"); }); diff --git a/test/cases/scope-hoisting/circular-namespace-object/index.js b/test/cases/scope-hoisting/circular-namespace-object/index.js index 34ccf6f64..bec400548 100644 --- a/test/cases/scope-hoisting/circular-namespace-object/index.js +++ b/test/cases/scope-hoisting/circular-namespace-object/index.js @@ -1,5 +1,5 @@ import value from "./module"; it("should have access to namespace object before evaluation", function() { - value.should.be.eql("ok"); + expect(value).toBe("ok"); }); diff --git a/test/cases/scope-hoisting/export-namespace/index.js b/test/cases/scope-hoisting/export-namespace/index.js index 6c1b35d6f..b0d80a404 100644 --- a/test/cases/scope-hoisting/export-namespace/index.js +++ b/test/cases/scope-hoisting/export-namespace/index.js @@ -2,14 +2,14 @@ import { ns as ns1 } from "./module1"; const ns2 = require("./module2").ns; it("should allow to export a namespace object (concated)", function() { - ns1.should.be.eql({ + expect(ns1).toEqual({ a: "a", b: "b" }); }); it("should allow to export a namespace object (exposed)", function() { - ns2.should.be.eql({ + expect(ns2).toEqual({ a: "a", b: "b" }); diff --git a/test/cases/scope-hoisting/import-order/index.js b/test/cases/scope-hoisting/import-order/index.js index ce3eb1675..e4d2e75a5 100644 --- a/test/cases/scope-hoisting/import-order/index.js +++ b/test/cases/scope-hoisting/import-order/index.js @@ -3,5 +3,5 @@ import "./module"; import { log } from "./tracker"; it("should evaluate import in the correct order", function() { - log.should.be.eql(["commonjs", "module"]); + expect(log).toEqual(["commonjs", "module"]); }); diff --git a/test/cases/scope-hoisting/indirect-reexport/index.js b/test/cases/scope-hoisting/indirect-reexport/index.js index f9a31c159..44e195598 100644 --- a/test/cases/scope-hoisting/indirect-reexport/index.js +++ b/test/cases/scope-hoisting/indirect-reexport/index.js @@ -1,5 +1,5 @@ var c = require("./c"); it("should have the correct values", function() { - c.named.should.be.eql("named"); + expect(c.named).toBe("named"); }); diff --git a/test/cases/scope-hoisting/inside-class/index.js b/test/cases/scope-hoisting/inside-class/index.js index 63aa824b3..eba2d46a7 100644 --- a/test/cases/scope-hoisting/inside-class/index.js +++ b/test/cases/scope-hoisting/inside-class/index.js @@ -4,8 +4,8 @@ import { Foo as SecondFoo, Bar } from "./second" it("should renamed class reference in inner scope", function() { var a = new Foo().test(); var b = new SecondFoo().test(); - a.should.be.eql(1); - b.should.be.eql(2); - new FirstBar().test().should.be.eql(1); - new Bar().test().should.be.eql(2); + expect(a).toBe(1); + expect(b).toBe(2); + expect(new FirstBar().test()).toBe(1); + expect(new Bar().test()).toBe(2); }); diff --git a/test/cases/scope-hoisting/intra-references/index.js b/test/cases/scope-hoisting/intra-references/index.js index 371843667..b1169303c 100644 --- a/test/cases/scope-hoisting/intra-references/index.js +++ b/test/cases/scope-hoisting/intra-references/index.js @@ -1,7 +1,7 @@ import value from "./a"; it("should have the correct values", function() { - value.should.be.eql("ok"); + expect(value).toBe("ok"); }); diff --git a/test/cases/scope-hoisting/issue-5020-minimal/index.js b/test/cases/scope-hoisting/issue-5020-minimal/index.js index b992781ad..5a6efdf17 100644 --- a/test/cases/scope-hoisting/issue-5020-minimal/index.js +++ b/test/cases/scope-hoisting/issue-5020-minimal/index.js @@ -1,7 +1,7 @@ var testData = require("./src/index.js"); it("should export the correct values", function() { - testData.should.be.eql({ + expect(testData).toEqual({ icon: { svg: { default: 1 diff --git a/test/cases/scope-hoisting/issue-5020/index.js b/test/cases/scope-hoisting/issue-5020/index.js index f2ab49e39..a989f0816 100644 --- a/test/cases/scope-hoisting/issue-5020/index.js +++ b/test/cases/scope-hoisting/issue-5020/index.js @@ -1,7 +1,7 @@ var testData = require("./src/index.js"); it("should export the correct values", function() { - testData.should.be.eql({ + expect(testData).toEqual({ svg5: { svg: { clinical1: { diff --git a/test/cases/scope-hoisting/issue-5096/index.js b/test/cases/scope-hoisting/issue-5096/index.js index 0b7a38114..5da7dc001 100644 --- a/test/cases/scope-hoisting/issue-5096/index.js +++ b/test/cases/scope-hoisting/issue-5096/index.js @@ -9,5 +9,5 @@ if(Math.random() < -1) console.log(module); it("should compile fine", function() { - b.should.be.eql("a"); + expect(b).toBe("a"); }); diff --git a/test/cases/scope-hoisting/issue-5314/index.js b/test/cases/scope-hoisting/issue-5314/index.js index 2697608c7..d35a27e91 100644 --- a/test/cases/scope-hoisting/issue-5314/index.js +++ b/test/cases/scope-hoisting/issue-5314/index.js @@ -3,7 +3,7 @@ import a from "./module"; var obj = {}; it("should allow access to the default export of the root module", function() { - a().should.be.eql(obj); + expect(a()).toBe(obj); }); export default obj; diff --git a/test/cases/scope-hoisting/issue-5443/index.js b/test/cases/scope-hoisting/issue-5443/index.js index 5ce5559b2..5edce3165 100644 --- a/test/cases/scope-hoisting/issue-5443/index.js +++ b/test/cases/scope-hoisting/issue-5443/index.js @@ -1,7 +1,7 @@ import { module } from "./reexport"; it("should have the correct values", function() { - module.should.be.eql({ + expect(module).toEqual({ default: "default", named: "named" }); diff --git a/test/cases/scope-hoisting/issue-5481/index.js b/test/cases/scope-hoisting/issue-5481/index.js index b72050107..26fb8bd25 100644 --- a/test/cases/scope-hoisting/issue-5481/index.js +++ b/test/cases/scope-hoisting/issue-5481/index.js @@ -1,5 +1,5 @@ import value from "./module"; it("should not cause name conflicts", function() { - (typeof value).should.be.eql("undefined"); + expect((typeof value)).toBe("undefined"); }); diff --git a/test/cases/scope-hoisting/name-conflicts/index.js b/test/cases/scope-hoisting/name-conflicts/index.js index 486777033..351cbeac4 100644 --- a/test/cases/scope-hoisting/name-conflicts/index.js +++ b/test/cases/scope-hoisting/name-conflicts/index.js @@ -6,10 +6,10 @@ import value5 from "./module?{"; import value6 from "./module?}"; it("should not break on name conflicts", function() { - value1.should.be.eql("a"); - value2.should.be.eql("a"); - value3.should.be.eql("a"); - value4.should.be.eql("a"); - value5.should.be.eql("a"); - value6.should.be.eql("a"); + expect(value1).toBe("a"); + expect(value2).toBe("a"); + expect(value3).toBe("a"); + expect(value4).toBe("a"); + expect(value5).toBe("a"); + expect(value6).toBe("a"); }); diff --git a/test/cases/scope-hoisting/reexport-cjs/index.js b/test/cases/scope-hoisting/reexport-cjs/index.js index 5ac21327b..bfc180c27 100644 --- a/test/cases/scope-hoisting/reexport-cjs/index.js +++ b/test/cases/scope-hoisting/reexport-cjs/index.js @@ -1,5 +1,5 @@ import { named } from "./c"; it("should have the correct values", function() { - named.should.be.eql("named"); + expect(named).toBe("named"); }); diff --git a/test/cases/scope-hoisting/reexport-exposed-cjs/index.js b/test/cases/scope-hoisting/reexport-exposed-cjs/index.js index f9a31c159..44e195598 100644 --- a/test/cases/scope-hoisting/reexport-exposed-cjs/index.js +++ b/test/cases/scope-hoisting/reexport-exposed-cjs/index.js @@ -1,5 +1,5 @@ var c = require("./c"); it("should have the correct values", function() { - c.named.should.be.eql("named"); + expect(c.named).toBe("named"); }); diff --git a/test/cases/scope-hoisting/reexport-exposed-default-cjs/index.js b/test/cases/scope-hoisting/reexport-exposed-default-cjs/index.js index 80958b553..1043ef8a5 100644 --- a/test/cases/scope-hoisting/reexport-exposed-default-cjs/index.js +++ b/test/cases/scope-hoisting/reexport-exposed-default-cjs/index.js @@ -1,5 +1,5 @@ var c = require("./c"); it("should have the correct values", function() { - c.default.should.be.eql("default"); + expect(c.default).toBe("default"); }); diff --git a/test/cases/scope-hoisting/reexport-exposed-harmony/index.js b/test/cases/scope-hoisting/reexport-exposed-harmony/index.js index f9a31c159..44e195598 100644 --- a/test/cases/scope-hoisting/reexport-exposed-harmony/index.js +++ b/test/cases/scope-hoisting/reexport-exposed-harmony/index.js @@ -1,5 +1,5 @@ var c = require("./c"); it("should have the correct values", function() { - c.named.should.be.eql("named"); + expect(c.named).toBe("named"); }); diff --git a/test/cases/scope-hoisting/renaming-4967/index.js b/test/cases/scope-hoisting/renaming-4967/index.js index 445ebec05..bcde84c0d 100644 --- a/test/cases/scope-hoisting/renaming-4967/index.js +++ b/test/cases/scope-hoisting/renaming-4967/index.js @@ -1,5 +1,5 @@ it("should check existing variables when renaming", function() { - require("./module").d.x().should.be.eql("ok"); - require("./module").c.a().should.be.eql("ok"); - require("./module").test().should.be.eql("ok"); + expect(require("./module").d.x()).toBe("ok"); + expect(require("./module").c.a()).toBe("ok"); + expect(require("./module").test()).toBe("ok"); }); diff --git a/test/cases/scope-hoisting/renaming-shorthand-5027/index.js b/test/cases/scope-hoisting/renaming-shorthand-5027/index.js index 7a7318ea7..5b58a8401 100644 --- a/test/cases/scope-hoisting/renaming-shorthand-5027/index.js +++ b/test/cases/scope-hoisting/renaming-shorthand-5027/index.js @@ -1,7 +1,7 @@ import m from "./module"; it("should apply shorthand properties correctly when renaming", function() { - m.should.be.eql({ + expect(m).toEqual({ obj: { test: "test1", test2: "test2", diff --git a/test/cases/scope-hoisting/require-root-5604/index.js b/test/cases/scope-hoisting/require-root-5604/index.js index 0aeb495bb..040925c6b 100644 --- a/test/cases/scope-hoisting/require-root-5604/index.js +++ b/test/cases/scope-hoisting/require-root-5604/index.js @@ -2,7 +2,7 @@ import value, { self as moduleSelf } from "./module"; export var self = require("./"); it("should have the correct values", function() { - value.should.be.eql("default"); - moduleSelf.should.be.eql(self); - self.self.should.be.eql(self); + expect(value).toBe("default"); + expect(moduleSelf).toBe(self); + expect(self.self).toBe(self); }); diff --git a/test/cases/scope-hoisting/simple/index.js b/test/cases/scope-hoisting/simple/index.js index b0ca24d53..2df9c1a85 100644 --- a/test/cases/scope-hoisting/simple/index.js +++ b/test/cases/scope-hoisting/simple/index.js @@ -1,6 +1,6 @@ import value, { named } from "./module"; it("should have the correct values", function() { - value.should.be.eql("default"); - named.should.be.eql("named"); + expect(value).toBe("default"); + expect(named).toBe("named"); }); diff --git a/test/cases/wasm/import-wasm-wasm/index.js b/test/cases/wasm/import-wasm-wasm/index.js index bdc8813c3..f73e0b893 100644 --- a/test/cases/wasm/import-wasm-wasm/index.js +++ b/test/cases/wasm/import-wasm-wasm/index.js @@ -1,6 +1,6 @@ it("should allow to run a WebAssembly module with imports", function() { return import("./wasm.wasm").then(function(wasm) { const result = wasm.addNumber(20); - result.should.be.eql(42); + expect(result).toEqual(42); }); }); diff --git a/test/cases/wasm/imports-circular/index.js b/test/cases/wasm/imports-circular/index.js index c76871b00..288ab4213 100644 --- a/test/cases/wasm/imports-circular/index.js +++ b/test/cases/wasm/imports-circular/index.js @@ -1,5 +1,5 @@ it("should allow to run a WebAssembly module importing JS circular", function() { return import("./module").then(function(mod) { - mod.result.should.be.eql(42); + expect(mod.result).toBe(42); }); }); diff --git a/test/cases/wasm/imports/index.js b/test/cases/wasm/imports/index.js index d562c4a28..d71f2190c 100644 --- a/test/cases/wasm/imports/index.js +++ b/test/cases/wasm/imports/index.js @@ -1,6 +1,6 @@ it("should allow to run a WebAssembly module with imports", function() { return import("./wasm.wasm?1").then(function(wasm) { const result = wasm.addNumber(3); - result.should.be.eql(11); + expect(result).toEqual(11); }); }); diff --git a/test/cases/wasm/simple/index.js b/test/cases/wasm/simple/index.js index ab607d81b..b3069c705 100644 --- a/test/cases/wasm/simple/index.js +++ b/test/cases/wasm/simple/index.js @@ -1,13 +1,13 @@ it("should allow to run a WebAssembly module (indirect)", function() { return import("./module").then(function(module) { const result = module.run(); - result.should.be.eql(42); + expect(result).toEqual(42); }); }); it("should allow to run a WebAssembly module (direct)", function() { return import("./wasm.wasm?2").then(function(wasm) { const result = wasm.add(wasm.getNumber(), 2); - result.should.be.eql(42); + expect(result).toEqual(42); }); }); diff --git a/test/configCases/async-commons-chunk/all-selected/index.js b/test/configCases/async-commons-chunk/all-selected/index.js index 474da4c16..cfc15c09e 100644 --- a/test/configCases/async-commons-chunk/all-selected/index.js +++ b/test/configCases/async-commons-chunk/all-selected/index.js @@ -1,22 +1,22 @@ it("should load the full async commons", function(done) { require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); + expect(require("./a")).toBe("a"); done(); }); }); it("should load a chunk with async commons (AMD)", function(done) { require(["./a", "./b"], function(a, b) { - a.should.be.eql("a"); - b.should.be.eql("b"); + expect(a).toBe("a"); + expect(b).toBe("b"); done(); }); }); it("should load a chunk with async commons (require.ensure)", function(done) { require.ensure([], function(require) { - require("./a").should.be.eql("a"); - require("./c").should.be.eql("c"); + expect(require("./a")).toBe("a"); + expect(require("./c")).toBe("c"); done(); }); }); diff --git a/test/configCases/async-commons-chunk/duplicate/index.js b/test/configCases/async-commons-chunk/duplicate/index.js index 8209ce099..7370a4064 100644 --- a/test/configCases/async-commons-chunk/duplicate/index.js +++ b/test/configCases/async-commons-chunk/duplicate/index.js @@ -1,28 +1,28 @@ it("should load nested commons chunk", function(done) { var counter = 0; require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); + expect(require("./a")).toBe("a"); require.ensure(["./c", "./d"], function(require) { - require("./c").should.be.eql("c"); - require("./d").should.be.eql("d"); + expect(require("./c")).toBe("c"); + expect(require("./d")).toBe("d"); if(++counter == 4) done(); }); require.ensure(["./c", "./e"], function(require) { - require("./c").should.be.eql("c"); - require("./e").should.be.eql("e"); + expect(require("./c")).toBe("c"); + expect(require("./e")).toBe("e"); if(++counter == 4) done(); }); }); require.ensure(["./b"], function(require) { - require("./b").should.be.eql("b"); + expect(require("./b")).toBe("b"); require.ensure(["./c", "./d"], function(require) { - require("./c").should.be.eql("c"); - require("./d").should.be.eql("d"); + expect(require("./c")).toBe("c"); + expect(require("./d")).toBe("d"); if(++counter == 4) done(); }); require.ensure(["./c", "./e"], function(require) { - require("./c").should.be.eql("c"); - require("./e").should.be.eql("e"); + expect(require("./c")).toBe("c"); + expect(require("./e")).toBe("e"); if(++counter == 4) done(); }); }); diff --git a/test/configCases/async-commons-chunk/existing-name/index.js b/test/configCases/async-commons-chunk/existing-name/index.js index 3166ba893..31da0708a 100644 --- a/test/configCases/async-commons-chunk/existing-name/index.js +++ b/test/configCases/async-commons-chunk/existing-name/index.js @@ -5,29 +5,29 @@ const chunkLoadingSpy = sinon.spy(__webpack_require__, "e"); it("should not have duplicate chunks in blocks", function(done) { // This split point should contain: a require.ensure([], function(require) { - require("./a").should.be.eql("a"); + expect(require("./a")).toBe("a"); }, "a"); // This split point should contain: a and b - we use CommonsChunksPlugin to // have it only contain b and make chunk a be an async dependency. require.ensure([], function(require) { - require("./a").should.be.eql("a"); - require("./b").should.be.eql("b"); + expect(require("./a")).toBe("a"); + expect(require("./b")).toBe("b"); }, "a+b"); // This split point should contain: a, b and c - we use CommonsChunksPlugin to // have it only contain c and make chunks a and a+b be async dependencies. require.ensure([], function(require) { - require("./a").should.be.eql("a"); - require("./b").should.be.eql("b"); - require("./c").should.be.eql("c"); + expect(require("./a")).toBe("a"); + expect(require("./b")).toBe("b"); + expect(require("./c")).toBe("c"); }, "a+b+c"); // Each of the require.ensures above should end up resolving chunks: // - a // - a, a+b // - a, a+b, a+b+c - chunkLoadingSpy.callCount.should.be.eql(6); - chunkLoadingSpy.args.should.be.eql([["a"], ["a"], ["a+b~a+b+c" /* == b */], ["a"], ["a+b~a+b+c" /* == b */], ["a+b+c"]]); + expect(chunkLoadingSpy.callCount).toBe(6); + expect(chunkLoadingSpy.args).toEqual([["a"], ["a"], ["a+b~a+b+c" /* == b */], ["a"], ["a+b~a+b+c" /* == b */], ["a+b+c"]]); done(); }); diff --git a/test/configCases/async-commons-chunk/nested/index.js b/test/configCases/async-commons-chunk/nested/index.js index 374a2cca8..255659c5c 100644 --- a/test/configCases/async-commons-chunk/nested/index.js +++ b/test/configCases/async-commons-chunk/nested/index.js @@ -1,19 +1,19 @@ it("should load nested commons chunk", function(done) { require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); + expect(require("./a")).toBe("a"); var counter = 0; require.ensure(["./b", "./c"], function(require) { - require("./b").should.be.eql("b"); - require("./c").should.be.eql("c"); + expect(require("./b")).toBe("b"); + expect(require("./c")).toBe("c"); if(++counter == 3) done(); }); require.ensure(["./b", "./d"], function(require) { - require("./b").should.be.eql("b"); - require("./d").should.be.eql("d"); + expect(require("./b")).toBe("b"); + expect(require("./d")).toBe("d"); if(++counter == 3) done(); }); require.ensure(["./b"], function(require) { - require("./b").should.be.eql("b"); + expect(require("./b")).toBe("b"); if(++counter == 3) done(); }); }); diff --git a/test/configCases/async-commons-chunk/simple/index.js b/test/configCases/async-commons-chunk/simple/index.js index 474da4c16..cfc15c09e 100644 --- a/test/configCases/async-commons-chunk/simple/index.js +++ b/test/configCases/async-commons-chunk/simple/index.js @@ -1,22 +1,22 @@ it("should load the full async commons", function(done) { require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); + expect(require("./a")).toBe("a"); done(); }); }); it("should load a chunk with async commons (AMD)", function(done) { require(["./a", "./b"], function(a, b) { - a.should.be.eql("a"); - b.should.be.eql("b"); + expect(a).toBe("a"); + expect(b).toBe("b"); done(); }); }); it("should load a chunk with async commons (require.ensure)", function(done) { require.ensure([], function(require) { - require("./a").should.be.eql("a"); - require("./c").should.be.eql("c"); + expect(require("./a")).toBe("a"); + expect(require("./c")).toBe("c"); done(); }); }); diff --git a/test/configCases/code-generation/require-context-id/index.js b/test/configCases/code-generation/require-context-id/index.js index a3002be89..c6da6e5f4 100644 --- a/test/configCases/code-generation/require-context-id/index.js +++ b/test/configCases/code-generation/require-context-id/index.js @@ -1,5 +1,5 @@ it("should escape require.context id correctly", function() { var context = require.context("./folder"); - context("./a").should.be.eql("a"); + expect(context("./a")).toBe("a"); context.id.should.be.type("string"); }); diff --git a/test/configCases/code-generation/use-strict/index.js b/test/configCases/code-generation/use-strict/index.js index ff811c676..cf05674be 100644 --- a/test/configCases/code-generation/use-strict/index.js +++ b/test/configCases/code-generation/use-strict/index.js @@ -15,7 +15,7 @@ it("should include only one use strict per module", function() { match = regExp.exec(source); } - matches.should.be.eql([ + expect(matches).toEqual([ "__webpack_require__.r(__webpack_exports__);", "/* unused harmony default export */ var _unused_webpack_default_export = (\"a\");", "__webpack_require__.r(__webpack_exports__);", diff --git a/test/configCases/commons-chunk-plugin/correct-order/index.js b/test/configCases/commons-chunk-plugin/correct-order/index.js index 10d9a9900..10eaf4c6e 100644 --- a/test/configCases/commons-chunk-plugin/correct-order/index.js +++ b/test/configCases/commons-chunk-plugin/correct-order/index.js @@ -3,11 +3,11 @@ require("should"); var a = require("./a"); it("should run", function() { - a.should.be.eql("a"); + expect(a).toBe("a"); }); var mainModule = require.main; it("should be main", function() { - mainModule.should.be.eql(module); + expect(mainModule).toBe(module); }); diff --git a/test/configCases/commons-chunk-plugin/hot-multi/first.js b/test/configCases/commons-chunk-plugin/hot-multi/first.js index 0775bfc22..034fd5fe3 100644 --- a/test/configCases/commons-chunk-plugin/hot-multi/first.js +++ b/test/configCases/commons-chunk-plugin/hot-multi/first.js @@ -4,5 +4,5 @@ require("./common"); it("should have the correct main flag for multi first module", function() { var multiModule = __webpack_require__.c[module.parents[0]]; - multiModule.hot._main.should.be.eql(true); + expect(multiModule.hot._main).toBe(true); }); diff --git a/test/configCases/commons-chunk-plugin/hot-multi/second.js b/test/configCases/commons-chunk-plugin/hot-multi/second.js index facb4a27e..12da2578a 100644 --- a/test/configCases/commons-chunk-plugin/hot-multi/second.js +++ b/test/configCases/commons-chunk-plugin/hot-multi/second.js @@ -4,5 +4,5 @@ require("./common"); it("should have the correct main flag for multi second module", function() { var multiModule = __webpack_require__.c[module.parents[0]]; - multiModule.hot._main.should.be.eql(true); + expect(multiModule.hot._main).toBe(true); }); diff --git a/test/configCases/commons-chunk-plugin/hot-multi/vendor.js b/test/configCases/commons-chunk-plugin/hot-multi/vendor.js index b2c70c298..abba7de3a 100644 --- a/test/configCases/commons-chunk-plugin/hot-multi/vendor.js +++ b/test/configCases/commons-chunk-plugin/hot-multi/vendor.js @@ -4,5 +4,5 @@ module.exports = "vendor"; it("should have the correct main flag for multi vendor module", function() { var multiModule = __webpack_require__.c[module.parents[0]]; - multiModule.hot._main.should.be.eql(true); + expect(multiModule.hot._main).toBe(true); }); diff --git a/test/configCases/commons-chunk-plugin/hot/index.js b/test/configCases/commons-chunk-plugin/hot/index.js index affedf39c..7179d70f8 100644 --- a/test/configCases/commons-chunk-plugin/hot/index.js +++ b/test/configCases/commons-chunk-plugin/hot/index.js @@ -2,10 +2,10 @@ require("should"); it("should have the correct main flag", function() { var a = require("./vendor"); - a._main.should.be.eql(false); - module.hot._main.should.be.eql(true); + expect(a._main).toBe(false); + expect(module.hot._main).toBe(true); }); it("should be main", function() { - require.main.should.be.eql(module); + expect(require.main).toBe(module); }); diff --git a/test/configCases/commons-chunk-plugin/inverted-order/index.js b/test/configCases/commons-chunk-plugin/inverted-order/index.js index 10d9a9900..10eaf4c6e 100644 --- a/test/configCases/commons-chunk-plugin/inverted-order/index.js +++ b/test/configCases/commons-chunk-plugin/inverted-order/index.js @@ -3,11 +3,11 @@ require("should"); var a = require("./a"); it("should run", function() { - a.should.be.eql("a"); + expect(a).toBe("a"); }); var mainModule = require.main; it("should be main", function() { - mainModule.should.be.eql(module); + expect(mainModule).toBe(module); }); diff --git a/test/configCases/commons-chunk-plugin/move-to-grandparent/index.js b/test/configCases/commons-chunk-plugin/move-to-grandparent/index.js index 5c459f215..abee1e85c 100644 --- a/test/configCases/commons-chunk-plugin/move-to-grandparent/index.js +++ b/test/configCases/commons-chunk-plugin/move-to-grandparent/index.js @@ -3,8 +3,8 @@ it("should correctly include indirect children in common chunk", function(done) import('./pageA'), import('./pageB').then(m => m.default) ]).then((imports) => { - imports[0].default.should.be.eql("reuse"); - imports[1].default.should.be.eql("reuse"); + expect(imports[0].default).toBe("reuse"); + expect(imports[1].default).toBe("reuse"); done(); }).catch(e => { done(e); diff --git a/test/configCases/commons-chunk-plugin/move-to-grandparent/second.js b/test/configCases/commons-chunk-plugin/move-to-grandparent/second.js index c661ef828..1de5d49a3 100644 --- a/test/configCases/commons-chunk-plugin/move-to-grandparent/second.js +++ b/test/configCases/commons-chunk-plugin/move-to-grandparent/second.js @@ -1,6 +1,6 @@ it("should handle indirect children with multiple parents correctly", function(done) { import('./pageB').then(b => { - b.default.should.be.eql("reuse"); +expect( b.default).toBe("reuse"); done() }).catch(e => { done(); diff --git a/test/configCases/commons-chunk-plugin/simple/index.js b/test/configCases/commons-chunk-plugin/simple/index.js index 60fcce8a7..11ff8ad6d 100644 --- a/test/configCases/commons-chunk-plugin/simple/index.js +++ b/test/configCases/commons-chunk-plugin/simple/index.js @@ -2,9 +2,9 @@ require("should"); it("should run", function() { var a = require("./a"); - a.should.be.eql("a"); + expect(a).toBe("a"); }); it("should be main", function() { - require.main.should.be.eql(module); -}); \ No newline at end of file + expect(require.main).toBe(module); +}); diff --git a/test/configCases/context-exclusion/simple/index.js b/test/configCases/context-exclusion/simple/index.js index 90ea02744..05202c1e6 100644 --- a/test/configCases/context-exclusion/simple/index.js +++ b/test/configCases/context-exclusion/simple/index.js @@ -3,9 +3,9 @@ function requireInContext(someVariable) { } it("should not exclude paths not matching the exclusion pattern", function() { - requireInContext("file").should.be.eql("thats good"); - requireInContext("check-here/file").should.be.eql("thats good"); - requireInContext("check-here/check-here/file").should.be.eql("thats good"); + expect(requireInContext("file")).toBe("thats good"); + expect(requireInContext("check-here/file")).toBe("thats good"); + expect(requireInContext("check-here/check-here/file")).toBe("thats good"); }); it("should exclude paths/files matching the exclusion pattern", function() { diff --git a/test/configCases/context-replacement/System.import/index.js b/test/configCases/context-replacement/System.import/index.js index b50ae4885..1c1cae849 100644 --- a/test/configCases/context-replacement/System.import/index.js +++ b/test/configCases/context-replacement/System.import/index.js @@ -1,6 +1,6 @@ it("should replace a async context with a manual map", function() { var a = "a"; return import(a).then(function(a) { - a.should.be.eql({ default: "b" }); + expect(a).toEqual({ default: "b" }); }); }); diff --git a/test/configCases/context-replacement/a/index.js b/test/configCases/context-replacement/a/index.js index a46ac19f2..ec1eba1a8 100644 --- a/test/configCases/context-replacement/a/index.js +++ b/test/configCases/context-replacement/a/index.js @@ -5,7 +5,7 @@ it("should replace a context with a new resource and reqExp", function(done) { }); } rqInContext("replaced", function(r) { - r.should.be.eql("ok"); + expect(r).toBe("ok"); done(); }); -}); \ No newline at end of file +}); diff --git a/test/configCases/context-replacement/b/index.js b/test/configCases/context-replacement/b/index.js index fb4221a4f..b01b43bec 100644 --- a/test/configCases/context-replacement/b/index.js +++ b/test/configCases/context-replacement/b/index.js @@ -2,5 +2,5 @@ it("should replace a context with a new regExp", function() { function rqInContext(x) { return require(x); } - rqInContext("./only-this").should.be.eql("ok"); -}); \ No newline at end of file + expect(rqInContext("./only-this")).toBe("ok"); +}); diff --git a/test/configCases/context-replacement/c/index.js b/test/configCases/context-replacement/c/index.js index 7f1b1afe4..3647798f5 100644 --- a/test/configCases/context-replacement/c/index.js +++ b/test/configCases/context-replacement/c/index.js @@ -2,11 +2,11 @@ it("should replace a context with a manual map", function() { function rqInContext(x) { return require(x); } - rqInContext("a").should.be.eql("a"); - rqInContext("b").should.be.eql("b"); - rqInContext("./c").should.be.eql("b"); - rqInContext("d").should.be.eql("d"); - rqInContext("./d").should.be.eql("d"); + expect(rqInContext("a")).toBe("a"); + expect(rqInContext("b")).toBe("b"); + expect(rqInContext("./c")).toBe("b"); + expect(rqInContext("d")).toBe("d"); + expect(rqInContext("./d")).toBe("d"); (function() { rqInContext("module-b") }.should.throw()); diff --git a/test/configCases/context-replacement/d/index.js b/test/configCases/context-replacement/d/index.js index e8a4f576f..325fd05f2 100644 --- a/test/configCases/context-replacement/d/index.js +++ b/test/configCases/context-replacement/d/index.js @@ -2,7 +2,7 @@ it("should replace a context with resource query and manual map", function() { function rqInContext(x) { return require(x); } - rqInContext("a").should.be.eql({ + expect(rqInContext("a")).toEqual({ resourceQuery: "?cats=meow", query: "?lions=roar", prev: "module.exports = \"a\";\n", diff --git a/test/configCases/custom-hash-function/xxhash/index.js b/test/configCases/custom-hash-function/xxhash/index.js index 903df73bd..9a989c6c4 100644 --- a/test/configCases/custom-hash-function/xxhash/index.js +++ b/test/configCases/custom-hash-function/xxhash/index.js @@ -2,7 +2,7 @@ it("should have unique ids", function () { var ids = []; for(var i = 1; i <= 15; i++) { var id = require("./files/file" + i + ".js"); - ids.indexOf(id).should.be.eql(-1); + expect(ids.indexOf(id)).toBe(-1); ids.push(id); } }); diff --git a/test/configCases/delegated-hash/simple/index.js b/test/configCases/delegated-hash/simple/index.js index 683240689..4a11393ae 100644 --- a/test/configCases/delegated-hash/simple/index.js +++ b/test/configCases/delegated-hash/simple/index.js @@ -1,7 +1,7 @@ it("should delegate the modules", function() { - require("./a").should.be.eql("a"); - require("./loader!./b").should.be.eql("b"); - require("./dir/c").should.be.eql("c"); - require("./d").should.be.eql("d"); - require("./e").should.be.eql("e"); + expect(require("./a")).toBe("a"); + expect(require("./loader!./b")).toBe("b"); + expect(require("./dir/c")).toBe("c"); + expect(require("./d")).toBe("d"); + expect(require("./e")).toBe("e"); }); diff --git a/test/configCases/delegated/simple/index.js b/test/configCases/delegated/simple/index.js index 43353216c..d918d437c 100644 --- a/test/configCases/delegated/simple/index.js +++ b/test/configCases/delegated/simple/index.js @@ -1,5 +1,5 @@ it("should delegate the modules", function() { - require("./a").should.be.eql("a"); - require("./loader!./b").should.be.eql("b"); - require("./dir/c").should.be.eql("c"); + expect(require("./a")).toBe("a"); + expect(require("./loader!./b")).toBe("b"); + expect(require("./dir/c")).toBe("c"); }); diff --git a/test/configCases/dll-plugin/1-use-dll/index.js b/test/configCases/dll-plugin/1-use-dll/index.js index 942617dbc..c0a423848 100644 --- a/test/configCases/dll-plugin/1-use-dll/index.js +++ b/test/configCases/dll-plugin/1-use-dll/index.js @@ -4,37 +4,37 @@ import { x1, y2 } from "./e"; import { x2, y1 } from "dll/e"; it("should load a module from dll", function() { - require("dll/a").should.be.eql("a"); + expect(require("dll/a")).toBe("a"); }); it("should load a module of non-default type without extension from dll", function() { - require("dll/f").should.be.eql("f"); + expect(require("dll/f")).toBe("f"); }); it("should load an async module from dll", function(done) { require("dll/b")().then(function(c) { - c.should.be.eql({ default: "c" }); + expect(c).toEqual({ default: "c" }); done(); }).catch(done); }); it("should load an harmony module from dll (default export)", function() { - d.should.be.eql("d"); + expect(d).toBe("d"); }); it("should load an harmony module from dll (star export)", function() { - x1.should.be.eql(123); - x2.should.be.eql(123); - y1.should.be.eql(456); - y2.should.be.eql(456); + expect(x1).toBe(123); + expect(x2).toBe(123); + expect(y1).toBe(456); + expect(y2).toBe(456); }); it("should load a module with loader applied", function() { - require("dll/g.abc.js").should.be.eql("number"); + expect(require("dll/g.abc.js")).toBe("number"); }); it("should give modules the correct ids", function() { - Object.keys(__webpack_modules__).filter(m => !m.startsWith("../..")).should.be.eql([ + Object.keys(__webpack_modules__).filter(m =>expect( !m.startsWith("../.."))).toEqual([ "./index.js", "dll-reference ../0-create-dll/dll.js", "dll/a.js", diff --git a/test/configCases/dll-plugin/2-use-dll-without-scope/index.js b/test/configCases/dll-plugin/2-use-dll-without-scope/index.js index fe5086064..5ea475290 100644 --- a/test/configCases/dll-plugin/2-use-dll-without-scope/index.js +++ b/test/configCases/dll-plugin/2-use-dll-without-scope/index.js @@ -4,37 +4,37 @@ import { x1, y2 } from "./e"; import { x2, y1 } from "../0-create-dll/e"; it("should load a module from dll", function() { - require("../0-create-dll/a").should.be.eql("a"); + expect(require("../0-create-dll/a")).toBe("a"); }); it("should load a module of non-default type without extension from dll", function() { - require("../0-create-dll/f").should.be.eql("f"); + expect(require("../0-create-dll/f")).toBe("f"); }); it("should load an async module from dll", function(done) { require("../0-create-dll/b")().then(function(c) { - c.should.be.eql({ default: "c" }); + expect(c).toEqual({ default: "c" }); done(); }).catch(done); }); it("should load an harmony module from dll (default export)", function() { - d.should.be.eql("d"); + expect(d).toBe("d"); }); it("should load an harmony module from dll (star export)", function() { - x1.should.be.eql(123); - x2.should.be.eql(123); - y1.should.be.eql(456); - y2.should.be.eql(456); + expect(x1).toBe(123); + expect(x2).toBe(123); + expect(y1).toBe(456); + expect(y2).toBe(456); }); it("should load a module with loader applied", function() { - require("../0-create-dll/g.abc.js").should.be.eql("number"); + expect(require("../0-create-dll/g.abc.js")).toBe("number"); }); it("should give modules the correct ids", function() { - Object.keys(__webpack_modules__).filter(m => !m.startsWith("../..")).should.be.eql([ + Object.keys(__webpack_modules__).filter(m =>expect( !m.startsWith("../.."))).toEqual([ "../0-create-dll/a.js", "../0-create-dll/b.js", "../0-create-dll/d.js", diff --git a/test/configCases/dll-plugin/3-use-dll-with-hashid/index.js b/test/configCases/dll-plugin/3-use-dll-with-hashid/index.js index 06b1d222a..bc2322ba7 100644 --- a/test/configCases/dll-plugin/3-use-dll-with-hashid/index.js +++ b/test/configCases/dll-plugin/3-use-dll-with-hashid/index.js @@ -4,29 +4,29 @@ import { x1, y2 } from "./e"; import { x2, y1 } from "../0-create-dll/e"; it("should load a module from dll", function() { - require("../0-create-dll/a").should.be.eql("a"); + expect(require("../0-create-dll/a")).toBe("a"); }); it("should load an async module from dll", function(done) { require("../0-create-dll/b")().then(function(c) { - c.should.be.eql({ default: "c" }); + expect(c).toEqual({ default: "c" }); done(); }).catch(done); }); it("should load an harmony module from dll (default export)", function() { - d.should.be.eql("d"); + expect(d).toBe("d"); }); it("should load an harmony module from dll (star export)", function() { - x1.should.be.eql(123); - x2.should.be.eql(123); - y1.should.be.eql(456); - y2.should.be.eql(456); + expect(x1).toBe(123); + expect(x2).toBe(123); + expect(y1).toBe(456); + expect(y2).toBe(456); }); it("should load a module with loader applied", function() { - require("../0-create-dll/g.abc.js").should.be.eql("number"); + expect(require("../0-create-dll/g.abc.js")).toBe("number"); }); diff --git a/test/configCases/entry/issue-1068/test.js b/test/configCases/entry/issue-1068/test.js index 8eb9b5d02..5c5e3570f 100644 --- a/test/configCases/entry/issue-1068/test.js +++ b/test/configCases/entry/issue-1068/test.js @@ -1,7 +1,7 @@ var order = global.order; delete global.order; it("should run the modules in the correct order", function() { - order.should.be.eql([ + expect(order).toEqual([ "a", "b", "c", diff --git a/test/configCases/externals/externals-in-chunk/index.js b/test/configCases/externals/externals-in-chunk/index.js index 7dcfdcf9f..6cbd2b4c3 100644 --- a/test/configCases/externals/externals-in-chunk/index.js +++ b/test/configCases/externals/externals-in-chunk/index.js @@ -6,11 +6,11 @@ it("should move externals in chunks into entry chunk", function(done) { source.should.containEql("5+" + (3+3)); import("./chunk").then(function(chunk) { - chunk.default.a.should.be.eql(3); + expect(chunk.default.a).toBe(3); chunk.default.b.then(function(chunk2) { - chunk2.default.should.be.eql(7); + expect(chunk2.default).toBe(7); import("external3").then(function(ex) { - ex.default.should.be.eql(11); + expect(ex.default).toBe(11); done(); }); }); diff --git a/test/configCases/externals/harmony/index.js b/test/configCases/externals/harmony/index.js index 904a2a0d1..c0e029c99 100644 --- a/test/configCases/externals/harmony/index.js +++ b/test/configCases/externals/harmony/index.js @@ -1,5 +1,5 @@ import external from "external"; it("should harmony import a dependency", function() { - external.should.be.eql("abc"); + expect(external).toBe("abc"); }); diff --git a/test/configCases/externals/non-umd-externals-umd/index.js b/test/configCases/externals/non-umd-externals-umd/index.js index 9ef058ee9..bb1d74334 100644 --- a/test/configCases/externals/non-umd-externals-umd/index.js +++ b/test/configCases/externals/non-umd-externals-umd/index.js @@ -4,7 +4,7 @@ var path = require("path"); it("should correctly import a UMD external", function() { var external = require("external0"); - external.should.be.eql("module 0"); + expect(external).toBe("module 0"); }); it("should contain `require()` statements for the UMD external", function() { @@ -14,7 +14,7 @@ it("should contain `require()` statements for the UMD external", function() { it("should correctly import a non-UMD external", function() { var external = require("external1"); - external.should.be.eql("abc"); + expect(external).toBe("abc"); }); it("should not contain `require()` statements for the non-UMD external", function() { diff --git a/test/configCases/externals/non-umd-externals-umd2/index.js b/test/configCases/externals/non-umd-externals-umd2/index.js index fdb4a1f50..c515dddbd 100644 --- a/test/configCases/externals/non-umd-externals-umd2/index.js +++ b/test/configCases/externals/non-umd-externals-umd2/index.js @@ -4,7 +4,7 @@ var path = require("path"); it("should correctly import a UMD2 external", function() { var external = require("external0"); - external.should.be.eql("module 0"); + expect(external).toBe("module 0"); }); it("should contain `require()` statements for the UMD2 external", function() { @@ -14,7 +14,7 @@ it("should contain `require()` statements for the UMD2 external", function() { it("should correctly import a non-UMD2 external", function() { var external = require("external1"); - external.should.be.eql("abc"); + expect(external).toBe("abc"); }); it("should not contain `require()` statements for the non-UMD2 external", function() { diff --git a/test/configCases/externals/optional-externals-cjs/index.js b/test/configCases/externals/optional-externals-cjs/index.js index d38bf3d30..41529ac41 100644 --- a/test/configCases/externals/optional-externals-cjs/index.js +++ b/test/configCases/externals/optional-externals-cjs/index.js @@ -3,8 +3,8 @@ it("should not fail on optional externals", function() { require("external"); } catch(e) { e.should.be.instanceof(Error); - e.code.should.be.eql("MODULE_NOT_FOUND"); + expect(e.code).toBe("MODULE_NOT_FOUND"); return; } throw new Error("It doesn't fail"); -}); \ No newline at end of file +}); diff --git a/test/configCases/externals/optional-externals-root/index.js b/test/configCases/externals/optional-externals-root/index.js index d38bf3d30..41529ac41 100644 --- a/test/configCases/externals/optional-externals-root/index.js +++ b/test/configCases/externals/optional-externals-root/index.js @@ -3,8 +3,8 @@ it("should not fail on optional externals", function() { require("external"); } catch(e) { e.should.be.instanceof(Error); - e.code.should.be.eql("MODULE_NOT_FOUND"); + expect(e.code).toBe("MODULE_NOT_FOUND"); return; } throw new Error("It doesn't fail"); -}); \ No newline at end of file +}); diff --git a/test/configCases/externals/optional-externals-umd/index.js b/test/configCases/externals/optional-externals-umd/index.js index d38bf3d30..41529ac41 100644 --- a/test/configCases/externals/optional-externals-umd/index.js +++ b/test/configCases/externals/optional-externals-umd/index.js @@ -3,8 +3,8 @@ it("should not fail on optional externals", function() { require("external"); } catch(e) { e.should.be.instanceof(Error); - e.code.should.be.eql("MODULE_NOT_FOUND"); + expect(e.code).toBe("MODULE_NOT_FOUND"); return; } throw new Error("It doesn't fail"); -}); \ No newline at end of file +}); diff --git a/test/configCases/externals/optional-externals-umd2-mixed/index.js b/test/configCases/externals/optional-externals-umd2-mixed/index.js index 67be49aaa..1c0ecd4da 100644 --- a/test/configCases/externals/optional-externals-umd2-mixed/index.js +++ b/test/configCases/externals/optional-externals-umd2-mixed/index.js @@ -4,8 +4,8 @@ it("should not fail on optional externals", function() { require("external"); } catch(e) { e.should.be.instanceof(Error); - e.code.should.be.eql("MODULE_NOT_FOUND"); + expect(e.code).toBe("MODULE_NOT_FOUND"); return; } throw new Error("It doesn't fail"); -}); \ No newline at end of file +}); diff --git a/test/configCases/externals/optional-externals-umd2/index.js b/test/configCases/externals/optional-externals-umd2/index.js index d38bf3d30..41529ac41 100644 --- a/test/configCases/externals/optional-externals-umd2/index.js +++ b/test/configCases/externals/optional-externals-umd2/index.js @@ -3,8 +3,8 @@ it("should not fail on optional externals", function() { require("external"); } catch(e) { e.should.be.instanceof(Error); - e.code.should.be.eql("MODULE_NOT_FOUND"); + expect(e.code).toBe("MODULE_NOT_FOUND"); return; } throw new Error("It doesn't fail"); -}); \ No newline at end of file +}); diff --git a/test/configCases/hash-length/hashed-module-ids/index.js b/test/configCases/hash-length/hashed-module-ids/index.js index 903df73bd..9a989c6c4 100644 --- a/test/configCases/hash-length/hashed-module-ids/index.js +++ b/test/configCases/hash-length/hashed-module-ids/index.js @@ -2,7 +2,7 @@ it("should have unique ids", function () { var ids = []; for(var i = 1; i <= 15; i++) { var id = require("./files/file" + i + ".js"); - ids.indexOf(id).should.be.eql(-1); + expect(ids.indexOf(id)).toBe(-1); ids.push(id); } }); diff --git a/test/configCases/library/1-use-library/default-test.js b/test/configCases/library/1-use-library/default-test.js index 0f0075243..ea4e84d0d 100644 --- a/test/configCases/library/1-use-library/default-test.js +++ b/test/configCases/library/1-use-library/default-test.js @@ -2,6 +2,6 @@ import d from "library"; var data = require("library"); it("should get default export from library (" + NAME + ")", function() { - data.should.be.eql("default-value"); - d.should.be.eql("default-value"); + expect(data).toBe("default-value"); + expect(d).toBe("default-value"); }); diff --git a/test/configCases/library/1-use-library/index.js b/test/configCases/library/1-use-library/index.js index 6aa92b911..9372b9067 100644 --- a/test/configCases/library/1-use-library/index.js +++ b/test/configCases/library/1-use-library/index.js @@ -2,13 +2,13 @@ import d from "library"; import { a, b, external } from "library"; it("should be able to import hamorny exports from library (" + NAME + ")", function() { - d.should.be.eql("default-value"); - a.should.be.eql("a"); - b.should.be.eql("b"); + expect(d).toBe("default-value"); + expect(a).toBe("a"); + expect(b).toBe("b"); if(typeof TEST_EXTERNAL !== "undefined" && TEST_EXTERNAL) { - external.should.be.eql(["external"]); + expect(external).toEqual(["external"]); external.should.be.equal(require("external")); } else { - external.should.be.eql("non-external"); + expect(external).toBe("non-external"); } }); diff --git a/test/configCases/library/b/index.js b/test/configCases/library/b/index.js index ec6626bc0..6fe35d718 100644 --- a/test/configCases/library/b/index.js +++ b/test/configCases/library/b/index.js @@ -4,8 +4,8 @@ it("should run", function() { it("should have exported", function(done) { setTimeout(function() { - exported.object.should.be.eql(module.exports.object); - exported.second.should.be.eql(module.exports.second); + expect(exported.object).toBe(module.exports.object); + expect(exported.second).toBe(module.exports.second); done(); }, 1); }); diff --git a/test/configCases/loaders/generate-ident/index.js b/test/configCases/loaders/generate-ident/index.js index 1ba367dbe..f4693e19c 100644 --- a/test/configCases/loaders/generate-ident/index.js +++ b/test/configCases/loaders/generate-ident/index.js @@ -1,6 +1,6 @@ it("should correctly pass complex query object with remaining request", function() { - require("./a").should.be.eql("ok"); - require("./b").should.be.eql("maybe"); - require("./c").should.be.eql("yes"); - require("./d").should.be.eql("ok"); + expect(require("./a")).toBe("ok"); + expect(require("./b")).toBe("maybe"); + expect(require("./c")).toBe("yes"); + expect(require("./d")).toBe("ok"); }); diff --git a/test/configCases/loaders/hot-in-context/index.js b/test/configCases/loaders/hot-in-context/index.js index 87b8abaca..a150c3a92 100644 --- a/test/configCases/loaders/hot-in-context/index.js +++ b/test/configCases/loaders/hot-in-context/index.js @@ -1,3 +1,3 @@ it("should have hmr flag in loader context", function() { - require("./loader!").should.be.eql(!!module.hot); + expect(require("./loader!")).toBe(!!module.hot); }); diff --git a/test/configCases/loaders/issue-3320/index.js b/test/configCases/loaders/issue-3320/index.js index 7dbdbd576..7d496b8eb 100644 --- a/test/configCases/loaders/issue-3320/index.js +++ b/test/configCases/loaders/issue-3320/index.js @@ -1,23 +1,23 @@ it("should resolve aliased loader module with query", function() { var foo = require('./a'); - foo.should.be.eql("someMessage"); + expect(foo).toBe("someMessage"); }); it("should favor explicit loader query over aliased query (options in rule)", function() { var foo = require('./b'); - foo.should.be.eql("someOtherMessage"); + expect(foo).toBe("someOtherMessage"); }); it("should favor explicit loader query over aliased query (inline query in rule)", function() { var foo = require('./b2'); - foo.should.be.eql("someOtherMessage"); + expect(foo).toBe("someOtherMessage"); }); it("should favor explicit loader query over aliased query (inline query in rule.use)", function() { var foo = require('./b3'); - foo.should.be.eql("someOtherMessage"); + expect(foo).toBe("someOtherMessage"); }); diff --git a/test/configCases/loaders/pre-post-loader/index.js b/test/configCases/loaders/pre-post-loader/index.js index 6a18d04e2..d69ad146f 100644 --- a/test/configCases/loaders/pre-post-loader/index.js +++ b/test/configCases/loaders/pre-post-loader/index.js @@ -1,6 +1,6 @@ it("should apply pre and post loaders correctly", function() { - require("./a").should.be.eql("resource loader2 loader1 loader3"); - require("!./a").should.be.eql("resource loader2 loader3"); - require("!!./a").should.be.eql("resource"); - require("-!./a").should.be.eql("resource loader3"); + expect(require("./a")).toBe("resource loader2 loader1 loader3"); + expect(require("!./a")).toBe("resource loader2 loader3"); + expect(require("!!./a")).toBe("resource"); + expect(require("-!./a")).toBe("resource loader3"); }); diff --git a/test/configCases/loaders/remaining-request/index.js b/test/configCases/loaders/remaining-request/index.js index 7285ccdba..53247f529 100644 --- a/test/configCases/loaders/remaining-request/index.js +++ b/test/configCases/loaders/remaining-request/index.js @@ -1,3 +1,3 @@ it("should correctly pass complex query object with remaining request", function() { - require("./a").should.be.eql("ok"); + expect(require("./a")).toBe("ok"); }); diff --git a/test/configCases/no-parse/module.exports/index.js b/test/configCases/no-parse/module.exports/index.js index fe0db2daa..3db446c82 100644 --- a/test/configCases/no-parse/module.exports/index.js +++ b/test/configCases/no-parse/module.exports/index.js @@ -1,4 +1,4 @@ it("should correctly export stuff from not parsed modules", function() { - require("./not-parsed-a").should.be.eql("ok"); - require("./not-parsed-b").should.be.eql("ok"); + expect(require("./not-parsed-a")).toBe("ok"); + expect(require("./not-parsed-b")).toBe("ok"); }); diff --git a/test/configCases/no-parse/no-parse-function/index.js b/test/configCases/no-parse/no-parse-function/index.js index fe0db2daa..3db446c82 100644 --- a/test/configCases/no-parse/no-parse-function/index.js +++ b/test/configCases/no-parse/no-parse-function/index.js @@ -1,4 +1,4 @@ it("should correctly export stuff from not parsed modules", function() { - require("./not-parsed-a").should.be.eql("ok"); - require("./not-parsed-b").should.be.eql("ok"); + expect(require("./not-parsed-a")).toBe("ok"); + expect(require("./not-parsed-b")).toBe("ok"); }); diff --git a/test/configCases/parsing/context/index.js b/test/configCases/parsing/context/index.js index baffd5e40..c11c62d9e 100644 --- a/test/configCases/parsing/context/index.js +++ b/test/configCases/parsing/context/index.js @@ -1,5 +1,5 @@ it("should automatically create contexts", function() { var template = "tmpl", templateFull = "./tmpl.js"; - require("../../../cases/parsing/context/templates/templateLoader")(templateFull).should.be.eql("test template"); - require("../../../cases/parsing/context/templates/templateLoaderIndirect")(templateFull).should.be.eql("test template"); -}); \ No newline at end of file + expect(require("../../../cases/parsing/context/templates/templateLoader")(templateFull)).toBe("test template"); + expect(require("../../../cases/parsing/context/templates/templateLoaderIndirect")(templateFull)).toBe("test template"); +}); diff --git a/test/configCases/parsing/extended-api/index.js b/test/configCases/parsing/extended-api/index.js index b33fb25bd..a1f2c9570 100644 --- a/test/configCases/parsing/extended-api/index.js +++ b/test/configCases/parsing/extended-api/index.js @@ -4,5 +4,5 @@ it("should have __webpack_hash__", function() { }); it("should have __webpack_chunkname__", function() { (typeof __webpack_chunkname__).should.be.type("string"); - __webpack_chunkname__.should.be.eql('other'); + expect(__webpack_chunkname__).toBe('other'); }); diff --git a/test/configCases/parsing/harmony-this-concat/index.js b/test/configCases/parsing/harmony-this-concat/index.js index af774470b..07e61a898 100644 --- a/test/configCases/parsing/harmony-this-concat/index.js +++ b/test/configCases/parsing/harmony-this-concat/index.js @@ -7,16 +7,16 @@ import * as abc from "./abc"; function x() { throw new Error("should not be executed"); } it("should have this = undefined on imported non-strict functions", function() { x - d().should.be.eql("undefined"); + expect(d()).toBe("undefined"); x - a().should.be.eql("undefined"); + expect(a()).toBe("undefined"); x - B().should.be.eql("undefined"); + expect(B()).toBe("undefined"); x abc.a().should.be.type("object"); x var thing = abc.a(); - Object.keys(thing).should.be.eql(["a", "b", "default"]); + expect(Object.keys(thing)).toEqual(["a", "b", "default"]); }); import C2, { C } from "./new"; diff --git a/test/configCases/parsing/harmony-this/index.js b/test/configCases/parsing/harmony-this/index.js index 5d3f2984e..b78f7db60 100644 --- a/test/configCases/parsing/harmony-this/index.js +++ b/test/configCases/parsing/harmony-this/index.js @@ -5,10 +5,10 @@ import d, {a, b as B, C as _C, D as _D, returnThisArrow, returnThisMember, that} import * as abc from "./abc"; it("should have this = undefined on harmony modules", function() { - (typeof that).should.be.eql("undefined"); - (typeof abc.that).should.be.eql("undefined"); - (typeof returnThisArrow()).should.be.eql("undefined"); - (typeof abc.returnThisArrow()).should.be.eql("undefined"); + expect((typeof that)).toBe("undefined"); + expect((typeof abc.that)).toBe("undefined"); + expect((typeof returnThisArrow())).toBe("undefined"); + expect((typeof abc.returnThisArrow())).toBe("undefined"); (function() { returnThisMember(); }).should.throw(); @@ -18,23 +18,23 @@ it("should have this = undefined on harmony modules", function() { }); it("should not break classes and functions", function() { - (new _C).foo().should.be.eql("bar"); - (new _D).prop().should.be.eql("ok"); + expect((new _C).foo()).toBe("bar"); + expect((new _D).prop()).toBe("ok"); }); function x() { throw new Error("should not be executed"); } it("should have this = undefined on imported non-strict functions", function() { x - d().should.be.eql("undefined"); + expect(d()).toBe("undefined"); x - a().should.be.eql("undefined"); + expect(a()).toBe("undefined"); x - B().should.be.eql("undefined"); + expect(B()).toBe("undefined"); x abc.a().should.be.type("object"); x var thing = abc.a(); - Object.keys(thing).should.be.eql(Object.keys(abc)); + expect(Object.keys(thing)).toBe(Object.keys(abc)); }); import C2, { C } from "./new"; diff --git a/test/configCases/parsing/issue-336/index.js b/test/configCases/parsing/issue-336/index.js index b6b5e2f84..5b4f4798e 100644 --- a/test/configCases/parsing/issue-336/index.js +++ b/test/configCases/parsing/issue-336/index.js @@ -1,4 +1,4 @@ it("should provide a module to a free var in a var decl", function() { var x = aaa.test; - x.should.be.eql("test"); -}); \ No newline at end of file + expect(x).toBe("test"); +}); diff --git a/test/configCases/parsing/issue-4857/index.js b/test/configCases/parsing/issue-4857/index.js index db6e32229..d04250a98 100644 --- a/test/configCases/parsing/issue-4857/index.js +++ b/test/configCases/parsing/issue-4857/index.js @@ -23,7 +23,7 @@ it("should transpile unreachable branches", () => { true ? count++ : import("NOT_REACHABLE"); false ? import("NOT_REACHABLE") : count++; - count.should.be.eql(6); + expect(count).toBe(6); }); it("should not remove hoisted variable declarations", () => { diff --git a/test/configCases/parsing/issue-5624/index.js b/test/configCases/parsing/issue-5624/index.js index 04fe1e478..8b4624326 100644 --- a/test/configCases/parsing/issue-5624/index.js +++ b/test/configCases/parsing/issue-5624/index.js @@ -2,10 +2,10 @@ import * as M from "./module"; it("should allow conditionals as callee", function() { var x = (true ? M.fn : M.fn)(); - x.should.be.eql("ok"); + expect(x).toBe("ok"); }); it("should allow conditionals as object", function() { var x = (true ? M : M).fn(); - x.should.be.eql("ok"); + expect(x).toBe("ok"); }); diff --git a/test/configCases/parsing/node-source-plugin-off/index.js b/test/configCases/parsing/node-source-plugin-off/index.js index ed447c13f..a31f12595 100644 --- a/test/configCases/parsing/node-source-plugin-off/index.js +++ b/test/configCases/parsing/node-source-plugin-off/index.js @@ -1,5 +1,5 @@ require("should"); it("should not load node-libs-browser when node option is false", function() { - (typeof process).should.be.eql("undefined"); + expect((typeof process)).toBe("undefined"); }); diff --git a/test/configCases/parsing/node-source-plugin/index.js b/test/configCases/parsing/node-source-plugin/index.js index 2e945a3e2..105368218 100644 --- a/test/configCases/parsing/node-source-plugin/index.js +++ b/test/configCases/parsing/node-source-plugin/index.js @@ -1,5 +1,5 @@ require("should"); it("should add node-libs-browser to target web by default", function() { - process.browser.should.be.eql(true); + expect(process.browser).toBe(true); }); diff --git a/test/configCases/parsing/relative-filedirname/index.js b/test/configCases/parsing/relative-filedirname/index.js index 6f2e4fc53..67ba48a4a 100644 --- a/test/configCases/parsing/relative-filedirname/index.js +++ b/test/configCases/parsing/relative-filedirname/index.js @@ -1,6 +1,6 @@ it("should define __dirname and __filename", function() { - __dirname.should.be.eql(""); - __filename.should.be.eql("index.js"); - require("./dir/file").dirname.should.be.eql("dir"); + expect(__dirname).toBe(""); + expect(__filename).toBe("index.js"); + expect(require("./dir/file").dirname).toBe("dir"); require("./dir/file").filename.should.match(/^dir[\\\/]file.js$/); -}); \ No newline at end of file +}); diff --git a/test/configCases/parsing/require.main/index.js b/test/configCases/parsing/require.main/index.js index c72bb927a..91a94843f 100644 --- a/test/configCases/parsing/require.main/index.js +++ b/test/configCases/parsing/require.main/index.js @@ -1,3 +1,3 @@ it("should define require.main", function() { - require.main.should.be.eql(module); + expect(require.main).toBe(module); }); diff --git a/test/configCases/parsing/system.import/index.js b/test/configCases/parsing/system.import/index.js index d294961f8..f6c2d8f8b 100644 --- a/test/configCases/parsing/system.import/index.js +++ b/test/configCases/parsing/system.import/index.js @@ -1,8 +1,8 @@ it("should answer typeof System correctly", () => { if(__SYSTEM__ === false) { - (typeof System).should.be.eql("undefined"); + expect((typeof System)).toBe("undefined"); } else { - (typeof System).should.be.eql("object"); + expect((typeof System)).toBe("object"); } }); @@ -12,7 +12,7 @@ it("should answer typeof System.import correctly", () => { typeof System.import; }).should.throw(); } else { - (typeof System.import).should.be.eql("function"); + expect((typeof System.import)).toBe("function"); } }); @@ -22,7 +22,7 @@ it("should be able to use System.import()", done => { if(__SYSTEM__ === false) { done(new Error("System.import should not be parsed")); } else { - mod.should.be.eql({ default: "ok" }); + expect(mod).toEqual({ default: "ok" }); done(); } }); diff --git a/test/configCases/performance/many-exports/index.js b/test/configCases/performance/many-exports/index.js index 09e6f3203..a68c803f1 100644 --- a/test/configCases/performance/many-exports/index.js +++ b/test/configCases/performance/many-exports/index.js @@ -1,5 +1,5 @@ import sum from "./reexport.loader.js!"; it("should compile a module with many harmony exports in acceptable time", function() { - sum.should.be.eql(499500); + expect(sum).toBe(499500); }); diff --git a/test/configCases/plugins/define-plugin/index.js b/test/configCases/plugins/define-plugin/index.js index 1e2051e50..152078c37 100644 --- a/test/configCases/plugins/define-plugin/index.js +++ b/test/configCases/plugins/define-plugin/index.js @@ -1,77 +1,77 @@ /* globals it, should */ it("should define FALSE", function() { - FALSE.should.be.eql(false); - (typeof TRUE).should.be.eql("boolean"); + expect(FALSE).toBe(false); + expect((typeof TRUE)).toBe("boolean"); var x = require(FALSE ? "fail" : "./a"); var y = FALSE ? require("fail") : require("./a"); }); it("should define CODE", function() { - CODE.should.be.eql(3); - (typeof CODE).should.be.eql("number"); + expect(CODE).toBe(3); + expect((typeof CODE)).toBe("number"); if(CODE !== 3) require("fail"); if(typeof CODE !== "number") require("fail"); }); it("should define FUNCTION", function() { - (FUNCTION(5)).should.be.eql(6); - (typeof FUNCTION).should.be.eql("function"); + expect((FUNCTION(5))).toBe(6); + expect((typeof FUNCTION)).toBe("function"); if(typeof FUNCTION !== "function") require("fail"); }); it("should define UNDEFINED", function() { - (typeof UNDEFINED).should.be.eql("undefined"); + expect((typeof UNDEFINED)).toBe("undefined"); if(typeof UNDEFINED !== "undefined") require("fail"); }); it("should define REGEXP", function() { - REGEXP.toString().should.be.eql("/abc/i"); - (typeof REGEXP).should.be.eql("object"); + expect(REGEXP.toString()).toBe("/abc/i"); + expect((typeof REGEXP)).toBe("object"); if(typeof REGEXP !== "object") require("fail"); }); it("should define OBJECT", function() { var o = OBJECT; - o.SUB.FUNCTION(10).should.be.eql(11); + expect(o.SUB.FUNCTION(10)).toBe(11); }); it("should define OBJECT.SUB.CODE", function() { - (typeof OBJECT.SUB.CODE).should.be.eql("number"); - OBJECT.SUB.CODE.should.be.eql(3); + expect((typeof OBJECT.SUB.CODE)).toBe("number"); + expect(OBJECT.SUB.CODE).toBe(3); if(OBJECT.SUB.CODE !== 3) require("fail"); if(typeof OBJECT.SUB.CODE !== "number") require("fail"); (function(sub) { // should not crash - sub.CODE.should.be.eql(3); + expect(sub.CODE).toBe(3); }(OBJECT.SUB)); }); it("should define OBJECT.SUB.STRING", function() { - (typeof OBJECT.SUB.STRING).should.be.eql("string"); - OBJECT.SUB.STRING.should.be.eql("string"); + expect((typeof OBJECT.SUB.STRING)).toBe("string"); + expect(OBJECT.SUB.STRING).toBe("string"); if(OBJECT.SUB.STRING !== "string") require("fail"); if(typeof OBJECT.SUB.STRING !== "string") require("fail"); (function(sub) { // should not crash - sub.STRING.should.be.eql("string"); + expect(sub.STRING).toBe("string"); }(OBJECT.SUB)); }); it("should define process.env.DEFINED_NESTED_KEY", function() { - (process.env.DEFINED_NESTED_KEY).should.be.eql(5); - (typeof process.env.DEFINED_NESTED_KEY).should.be.eql("number"); + expect((process.env.DEFINED_NESTED_KEY)).toBe(5); + expect((typeof process.env.DEFINED_NESTED_KEY)).toBe("number"); if(process.env.DEFINED_NESTED_KEY !== 5) require("fail"); if(typeof process.env.DEFINED_NESTED_KEY !== "number") require("fail"); var x = process.env.DEFINED_NESTED_KEY; - x.should.be.eql(5); + expect(x).toBe(5); var indirect = process.env; - (indirect.DEFINED_NESTED_KEY).should.be.eql(5); + expect((indirect.DEFINED_NESTED_KEY)).toBe(5); (function(env) { - (env.DEFINED_NESTED_KEY).should.be.eql(5); - (typeof env.DEFINED_NESTED_KEY).should.be.eql("number"); + expect((env.DEFINED_NESTED_KEY)).toBe(5); + expect((typeof env.DEFINED_NESTED_KEY)).toBe("number"); if(env.DEFINED_NESTED_KEY !== 5) require("fail"); if(typeof env.DEFINED_NESTED_KEY !== "number") require("fail"); var x = env.DEFINED_NESTED_KEY; - x.should.be.eql(5); + expect(x).toBe(5); }(process.env)); }); it("should define process.env.DEFINED_NESTED_KEY_STRING", function() { @@ -79,7 +79,7 @@ it("should define process.env.DEFINED_NESTED_KEY_STRING", function() { }); it("should assign to process.env", function() { process.env.TEST = "test"; - process.env.TEST.should.be.eql("test"); + expect(process.env.TEST).toBe("test"); }); it("should not have brakets on start", function() { function f() { @@ -111,6 +111,6 @@ it("should follow renamings in var (issue 5215)", function() { var _process$env = process.env, TEST = _process$env.TEST, DEFINED_NESTED_KEY = _process$env.DEFINED_NESTED_KEY; - TEST.should.be.eql("test"); - DEFINED_NESTED_KEY.should.be.eql(5); + expect(TEST).toBe("test"); + expect(DEFINED_NESTED_KEY).toBe(5); }); diff --git a/test/configCases/plugins/lib-manifest-plugin/index.js b/test/configCases/plugins/lib-manifest-plugin/index.js index 30e1318de..4db3af83b 100644 --- a/test/configCases/plugins/lib-manifest-plugin/index.js +++ b/test/configCases/plugins/lib-manifest-plugin/index.js @@ -3,7 +3,7 @@ var path = require("path"); it("should complete", function(done) { require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); + expect(require("./a")).toBe("a"); done(); }); }); diff --git a/test/configCases/plugins/loader-options-plugin/index.js b/test/configCases/plugins/loader-options-plugin/index.js index ec6279f29..efce2b7fc 100644 --- a/test/configCases/plugins/loader-options-plugin/index.js +++ b/test/configCases/plugins/loader-options-plugin/index.js @@ -1,11 +1,11 @@ it("should set correct options on js files", function() { - require("./loader!./index.js").should.be.eql({ + expect(require("./loader!./index.js")).toEqual({ minimize: true, jsfile: true }); }); it("should set correct options on other files", function() { - require("./loader!./txt.txt").should.be.eql({ + expect(require("./loader!./txt.txt")).toEqual({ minimize: true }); }); diff --git a/test/configCases/plugins/min-chunk-size/index.js b/test/configCases/plugins/min-chunk-size/index.js index 33290592b..fb7861444 100644 --- a/test/configCases/plugins/min-chunk-size/index.js +++ b/test/configCases/plugins/min-chunk-size/index.js @@ -1,18 +1,18 @@ it("should combine two chunk if too small", done => { // b should not yet available var bf = __webpack_modules__[require.resolveWeak("./b")]; - (typeof bf).should.be.eql("undefined"); + expect((typeof bf)).toBe("undefined"); // load a import("./a").then(a => { - a.default.should.be.eql("a"); + expect(a.default).toBe("a"); // check if b is available too var bf = __webpack_modules__[require.resolveWeak("./b")]; - (typeof bf).should.be.eql("function"); + expect((typeof bf)).toBe("function"); // load b (just to check if it's ok) import("./b").then(b => { - b.default.should.be.eql("b"); + expect(b.default).toBe("b"); done(); }).catch(done); }).catch(done); diff --git a/test/configCases/plugins/provide-plugin/index.js b/test/configCases/plugins/provide-plugin/index.js index 5f1c9a45d..50a792f35 100644 --- a/test/configCases/plugins/provide-plugin/index.js +++ b/test/configCases/plugins/provide-plugin/index.js @@ -1,54 +1,54 @@ it("should provide a module for a simple free var", function() { - aaa.should.be.eql("aaa"); + expect(aaa).toBe("aaa"); }); it("should provide a module for a nested var", function() { - (bbb.ccc).should.be.eql("bbbccc"); + expect((bbb.ccc)).toBe("bbbccc"); var x = bbb.ccc; - x.should.be.eql("bbbccc"); + expect(x).toBe("bbbccc"); }); it("should provide a module for a nested var within a IIFE's argument", function() { (function(process) { - (process.env.NODE_ENV).should.be.eql("development"); + expect((process.env.NODE_ENV)).toBe("development"); var x = process.env.NODE_ENV; - x.should.be.eql("development"); + expect(x).toBe("development"); }(process)); }); it("should provide a module for a nested var within a IIFE's this", function() { (function() { - (this.env.NODE_ENV).should.be.eql("development"); + expect((this.env.NODE_ENV)).toBe("development"); var x = this.env.NODE_ENV; - x.should.be.eql("development"); + expect(x).toBe("development"); }.call(process)); }); it("should provide a module for a nested var within a nested IIFE's this", function() { (function() { (function() { - (this.env.NODE_ENV).should.be.eql("development"); + expect((this.env.NODE_ENV)).toBe("development"); var x = this.env.NODE_ENV; - x.should.be.eql("development"); + expect(x).toBe("development"); }.call(this)); }.call(process)); }); it("should not provide a module for a part of a var", function() { - (typeof bbb).should.be.eql("undefined"); + expect((typeof bbb)).toBe("undefined"); }); it("should provide a module for a property request", function() { - (dddeeefff).should.be.eql("fff"); + expect((dddeeefff)).toBe("fff"); var x = dddeeefff; - x.should.be.eql("fff"); + expect(x).toBe("fff"); }); it("should provide ES2015 modules", function() { - (es2015.default).should.be.eql("ECMAScript 2015"); - (es2015.alias).should.be.eql("ECMAScript Harmony"); - (es2015.year).should.be.eql(2015); - (es2015_name).should.be.eql("ECMAScript 2015"); - (es2015_alias).should.be.eql("ECMAScript Harmony"); - (es2015_year).should.be.eql(2015); + expect((es2015.default)).toBe("ECMAScript 2015"); + expect((es2015.alias)).toBe("ECMAScript Harmony"); + expect((es2015.year)).toBe(2015); + expect((es2015_name)).toBe("ECMAScript 2015"); + expect((es2015_alias)).toBe("ECMAScript Harmony"); + expect((es2015_year)).toBe(2015); }); diff --git a/test/configCases/rule-set/chaining/index.js b/test/configCases/rule-set/chaining/index.js index ca3b76c2c..ccb162203 100644 --- a/test/configCases/rule-set/chaining/index.js +++ b/test/configCases/rule-set/chaining/index.js @@ -1,6 +1,6 @@ it("should match rule with multiple loaders in 'loader'", function() { var abc = require("./abc"); - abc.should.be.eql([ + expect(abc).toEqual([ "abc", "?b", "?a" @@ -8,7 +8,7 @@ it("should match rule with multiple loaders in 'loader'", function() { }); it("should match rule with multiple loaders in 'loaders'", function() { var def = require("./def"); - def.should.be.eql([ + expect(def).toEqual([ "def", "?d", "?c" diff --git a/test/configCases/rule-set/compiler/index.js b/test/configCases/rule-set/compiler/index.js index ae9a155a9..6eb52e6c4 100644 --- a/test/configCases/rule-set/compiler/index.js +++ b/test/configCases/rule-set/compiler/index.js @@ -1,6 +1,6 @@ it("should match rule with compiler name", function() { var a = require("./a"); - a.should.be.eql("loader matched"); + expect(a).toBe("loader matched"); var b = require("./b"); - b.should.be.eql("loader not matched"); + expect(b).toBe("loader not matched"); }); diff --git a/test/configCases/rule-set/custom/index.js b/test/configCases/rule-set/custom/index.js index 8c73ef9fa..e4894af51 100644 --- a/test/configCases/rule-set/custom/index.js +++ b/test/configCases/rule-set/custom/index.js @@ -1,6 +1,6 @@ it("should match a custom loader", function() { var a = require("./a"); - a.should.be.eql([ + expect(a).toEqual([ "a", { issuer: "index.js", @@ -9,7 +9,7 @@ it("should match a custom loader", function() { } ]); var b = require("./b?hello"); - b.should.be.eql([ + expect(b).toEqual([ "b", { issuer: "index.js", @@ -18,7 +18,7 @@ it("should match a custom loader", function() { } ]); var ca = require("./call-a?hello"); - ca.should.be.eql([ + expect(ca).toEqual([ "a", { issuer: "call-a.js", diff --git a/test/configCases/rule-set/query/index.js b/test/configCases/rule-set/query/index.js index baeb9e1e9..7114b9778 100644 --- a/test/configCases/rule-set/query/index.js +++ b/test/configCases/rule-set/query/index.js @@ -1,15 +1,15 @@ it("should match rule with resource query", function() { var a1 = require("./a"); - a1.should.be.eql([ + expect(a1).toEqual([ "a" ]); var a2 = require("./a?loader"); - a2.should.be.eql([ + expect(a2).toEqual([ "a", "?query" ]); var a3 = require("./a?other"); - a3.should.be.eql([ + expect(a3).toEqual([ "a" ]); }); diff --git a/test/configCases/rule-set/resolve-options/index.js b/test/configCases/rule-set/resolve-options/index.js index c5da4bedd..5baf4c239 100644 --- a/test/configCases/rule-set/resolve-options/index.js +++ b/test/configCases/rule-set/resolve-options/index.js @@ -1,6 +1,6 @@ it("should allow to set custom resolving rules", function() { var a = require("./a"); - a.should.be.eql("ok"); + expect(a).toBe("ok"); var b = require("./b"); - b.should.be.eql("wrong"); + expect(b).toBe("wrong"); }); diff --git a/test/configCases/rule-set/simple-use-array-fn/index.js b/test/configCases/rule-set/simple-use-array-fn/index.js index 5c0fb1255..64637f8ab 100644 --- a/test/configCases/rule-set/simple-use-array-fn/index.js +++ b/test/configCases/rule-set/simple-use-array-fn/index.js @@ -1,6 +1,6 @@ it("should match only one rule in a oneOf block", function() { var ab = require("./ab"); - ab.should.be.eql([ + expect(ab).toEqual([ "ab", "?first" ]); @@ -8,11 +8,11 @@ it("should match only one rule in a oneOf block", function() { it("should match with issuer and any option value", function() { var a = require("./a"); var b = require("./b"); - a.should.be.eql([ + expect(a).toEqual([ "a", "?third", ]); - b.should.be.eql([[ + expect(b).toEqual([[ "a", "second-3", "?second-2", diff --git a/test/configCases/rule-set/simple-use-fn-array/index.js b/test/configCases/rule-set/simple-use-fn-array/index.js index 5c0fb1255..64637f8ab 100644 --- a/test/configCases/rule-set/simple-use-fn-array/index.js +++ b/test/configCases/rule-set/simple-use-fn-array/index.js @@ -1,6 +1,6 @@ it("should match only one rule in a oneOf block", function() { var ab = require("./ab"); - ab.should.be.eql([ + expect(ab).toEqual([ "ab", "?first" ]); @@ -8,11 +8,11 @@ it("should match only one rule in a oneOf block", function() { it("should match with issuer and any option value", function() { var a = require("./a"); var b = require("./b"); - a.should.be.eql([ + expect(a).toEqual([ "a", "?third", ]); - b.should.be.eql([[ + expect(b).toEqual([[ "a", "second-3", "?second-2", diff --git a/test/configCases/rule-set/simple/index.js b/test/configCases/rule-set/simple/index.js index 5c0fb1255..64637f8ab 100644 --- a/test/configCases/rule-set/simple/index.js +++ b/test/configCases/rule-set/simple/index.js @@ -1,6 +1,6 @@ it("should match only one rule in a oneOf block", function() { var ab = require("./ab"); - ab.should.be.eql([ + expect(ab).toEqual([ "ab", "?first" ]); @@ -8,11 +8,11 @@ it("should match only one rule in a oneOf block", function() { it("should match with issuer and any option value", function() { var a = require("./a"); var b = require("./b"); - a.should.be.eql([ + expect(a).toEqual([ "a", "?third", ]); - b.should.be.eql([[ + expect(b).toEqual([[ "a", "second-3", "?second-2", diff --git a/test/configCases/scope-hoisting/dll-plugin/index.js b/test/configCases/scope-hoisting/dll-plugin/index.js index 90b28ea4e..c1533a31a 100644 --- a/test/configCases/scope-hoisting/dll-plugin/index.js +++ b/test/configCases/scope-hoisting/dll-plugin/index.js @@ -1,5 +1,5 @@ import value from "dll/module"; it("should not scope hoist delegated modules", function() { - value.should.be.eql("ok"); + expect(value).toBe("ok"); }); diff --git a/test/configCases/scope-hoisting/named-modules/index.js b/test/configCases/scope-hoisting/named-modules/index.js index 2339e0ccd..9e915eb93 100644 --- a/test/configCases/scope-hoisting/named-modules/index.js +++ b/test/configCases/scope-hoisting/named-modules/index.js @@ -1,5 +1,5 @@ import value from "./module"; it("should generate valid code", function() { - value.should.be.eql("ok"); + expect(value).toBe("ok"); }); diff --git a/test/configCases/scope-hoisting/strictThisContextOnImports/index.js b/test/configCases/scope-hoisting/strictThisContextOnImports/index.js index 9f14a7229..174d19ee4 100644 --- a/test/configCases/scope-hoisting/strictThisContextOnImports/index.js +++ b/test/configCases/scope-hoisting/strictThisContextOnImports/index.js @@ -2,10 +2,10 @@ import value, { identity } from "./module"; import * as m from "./module"; it("should parse and translate identifiers correctly", function() { - identity(value).should.be.eql(1234); - m.identity(value).should.be.eql(1234); - m.identity(identity).should.be.eql(identity); - m.identity(m.identity).should.be.eql(m.identity); - identity(m.identity).should.be.eql(m.identity); - identity(m.default).should.be.eql(1234); + expect(identity(value)).toBe(1234); + expect(m.identity(value)).toBe(1234); + expect(m.identity(identity)).toBe(identity); + expect(m.identity(m.identity)).toBe(m.identity); + expect(identity(m.identity)).toBe(m.identity); + expect(identity(m.default)).toBe(1234); }); diff --git a/test/configCases/side-effects/side-effects-override/index.js b/test/configCases/side-effects/side-effects-override/index.js index b15057fe0..ca444036a 100644 --- a/test/configCases/side-effects/side-effects-override/index.js +++ b/test/configCases/side-effects/side-effects-override/index.js @@ -4,8 +4,8 @@ import p from "pmodule"; import n from "nmodule"; it("should be able to override side effects", function() { - p.should.be.eql("def"); - n.should.be.eql("def"); - plog.should.be.eql(["a.js", "b.js", "c.js", "index.js"]); - nlog.should.be.eql(["index.js"]); + expect(p).toBe("def"); + expect(n).toBe("def"); + expect(plog).toEqual(["a.js", "b.js", "c.js", "index.js"]); + expect(nlog).toEqual(["index.js"]); }); diff --git a/test/configCases/source-map/relative-source-map-path/index.js b/test/configCases/source-map/relative-source-map-path/index.js index 3a94a8228..801f5b353 100644 --- a/test/configCases/source-map/relative-source-map-path/index.js +++ b/test/configCases/source-map/relative-source-map-path/index.js @@ -2,7 +2,7 @@ it("should have a relative url to the source-map", function() { var fs = require("fs"); var source = fs.readFileSync(__filename, "utf-8"); var match = /sourceMappingURL\s*=\s*(.*)/.exec(source); - match[1].should.be.eql("bundle0.js.map"); + expect(match[1]).toBe("bundle0.js.map"); }); it("should have a relative url to the source-map with prefix", function(done) { diff --git a/test/configCases/source-map/relative-source-map-path/test.js b/test/configCases/source-map/relative-source-map-path/test.js index 46627acd3..02ac3dd39 100644 --- a/test/configCases/source-map/relative-source-map-path/test.js +++ b/test/configCases/source-map/relative-source-map-path/test.js @@ -1,4 +1,4 @@ var fs = require("fs"); var source = fs.readFileSync(__filename, "utf-8"); var match = /sourceMappingURL\s*=\s*(.*)/.exec(source); -match[1].should.be.eql("c.js.map"); \ No newline at end of file +expect(match[1]).toBe("c.js.map"); diff --git a/test/configCases/source-map/source-map-filename-contenthash/index.js b/test/configCases/source-map/source-map-filename-contenthash/index.js index 455b624c9..dd9fc97ab 100644 --- a/test/configCases/source-map/source-map-filename-contenthash/index.js +++ b/test/configCases/source-map/source-map-filename-contenthash/index.js @@ -2,5 +2,5 @@ it("should contain contenthash as query parameter and path", function() { var fs = require("fs"); var source = fs.readFileSync(__filename, "utf-8"); var match = /sourceMappingURL\s*=.*-([A-Fa-f0-9]{32})\.map\?([A-Fa-f0-9]{32})-([A-Fa-f0-9]{32})/.exec(source); - match.length.should.be.eql(4); + expect(match.length).toBe(4); }); diff --git a/test/configCases/target/buffer-default/index.js b/test/configCases/target/buffer-default/index.js index 8ffa85e2f..9b2008684 100644 --- a/test/configCases/target/buffer-default/index.js +++ b/test/configCases/target/buffer-default/index.js @@ -6,5 +6,5 @@ it("should provide a global Buffer shim", function () { it("should provide the buffer module", function () { var buffer = require("buffer"); - (typeof buffer).should.be.eql("object"); + expect((typeof buffer)).toBe("object"); }); diff --git a/test/configCases/target/node-dynamic-import/index.js b/test/configCases/target/node-dynamic-import/index.js index e5bcc97a8..0a0ac4e00 100644 --- a/test/configCases/target/node-dynamic-import/index.js +++ b/test/configCases/target/node-dynamic-import/index.js @@ -2,11 +2,11 @@ function testCase(load, done) { load("two", 2, function() { var sync = true; load("one", 1, function() { - sync.should.be.eql(false); + expect(sync).toBe(false); load("three", 3, function() { var sync = true; load("two", 2, function() { - sync.should.be.eql(true); + expect(sync).toBe(true); done(); }); Promise.resolve().then(function() {}).then(function() {}).then(function() { @@ -23,7 +23,7 @@ function testCase(load, done) { it("should be able to use expressions in import", function(done) { function load(name, expected, callback) { import("./dir/" + name + '.js') - .then((result) => {result.should.be.eql({ default: expected }); callback()}) + .then((result) => {expect(result).toEqual({ default: expected }); callback()}) .catch((err) => {done(err)}); } testCase(load, done); @@ -32,7 +32,7 @@ it("should be able to use expressions in import", function(done) { it("should be able to use expressions in lazy-once import", function(done) { function load(name, expected, callback) { import(/* webpackMode: "lazy-once" */ "./dir/" + name + '.js') - .then((result) => {result.should.be.eql({ default: expected }); callback()}) + .then((result) => {expect(result).toEqual({ default: expected }); callback()}) .catch((err) => {done(err)}); } testCase(load, done); @@ -41,7 +41,7 @@ it("should be able to use expressions in lazy-once import", function(done) { it("should be able to use expressions in import", function(done) { function load(name, expected, callback) { import("./dir2/" + name).then((result) => { - result.should.be.eql({ default: expected }); + expect(result).toEqual({ default: expected }); callback(); }).catch((err) => { done(err); @@ -51,12 +51,12 @@ it("should be able to use expressions in import", function(done) { }); it("should convert to function in node", function() { - (typeof __webpack_require__.e).should.be.eql("function"); + expect((typeof __webpack_require__.e)).toBe("function"); }) it("should be able to use import", function(done) { import("./two").then((two) => { - two.should.be.eql({ default: 2 }); + expect(two).toEqual({ default: 2 }); done(); }).catch(function(err) { done(err); diff --git a/test/configCases/target/strict-mode-global/index.js b/test/configCases/target/strict-mode-global/index.js index da530ef4d..1ac581718 100644 --- a/test/configCases/target/strict-mode-global/index.js +++ b/test/configCases/target/strict-mode-global/index.js @@ -3,6 +3,6 @@ require("should"); it("should be able to use global in strict mode", function() { - (typeof global).should.be.eql("object"); - (global === null).should.be.eql(false) + expect((typeof global)).toBe("object"); + expect((global === null)).toBe(false) }); diff --git a/test/configCases/target/web/index.js b/test/configCases/target/web/index.js index 5b659b746..63fd0dbe8 100644 --- a/test/configCases/target/web/index.js +++ b/test/configCases/target/web/index.js @@ -97,5 +97,5 @@ it("should provide a zlib shim", function () { }); it("should provide a shim for a path in a build-in module", function () { - require("process/in.js").should.be.eql("in process"); + expect(require("process/in.js")).toBe("in process"); }); diff --git a/test/configCases/target/webworker/index.js b/test/configCases/target/webworker/index.js index 63a9cf2ce..79b3752c3 100644 --- a/test/configCases/target/webworker/index.js +++ b/test/configCases/target/webworker/index.js @@ -94,5 +94,5 @@ it("should provide a zlib shim", function () { }); it("should provide a shim for a path in a build-in module", function () { - require("process/in.js").should.be.eql("in process"); + expect(require("process/in.js")).toBe("in process"); });