migrate should to expect, part 1

used regexps:

([\(\)a-zA-Z0-9\."'/ +{}\[\]=\-,:?_!]+)\.should\.be\.eql
➡️
expect($1).toBe

expect\(([\(\)a-zA-Z0-9\."'/ +{}\[\]=\-,:?_!]+)\)\.toBe\(\[
➡️
expect($1).toEqual([

expect\(([\(\)a-zA-Z0-9\."'/ +{}\[\]=\-,:?_!]+)\)\.toBe\(\{
➡️
expect($1).toEqual({
This commit is contained in:
Bazyli Brzóska 2018-01-26 22:51:03 +01:00
parent 009772cb20
commit 5a8083a930
242 changed files with 923 additions and 923 deletions

View File

@ -60,7 +60,7 @@ describe("ExternalModule", () => {
expect(externalModule.getSource.callCount).toBe(1); expect(externalModule.getSource.callCount).toBe(1);
expect(externalModule.getSourceString.callCount).toBe(1); expect(externalModule.getSourceString.callCount).toBe(1);
expect(externalModule.getSource.args[0][0]).toBe(expectedString); 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); const result = externalModule.getSource(someSourceString);
// check // check
expect(result).toBeInstanceOf(OriginalSource); expect(result).toEqualInstanceOf(OriginalSource);
}); });
}); });
describe("given it does not use source maps", () => { describe("given it does not use source maps", () => {
@ -92,7 +92,7 @@ describe("ExternalModule", () => {
const result = externalModule.getSource(someSourceString); const result = externalModule.getSource(someSourceString);
// check // check
expect(result).toBeInstanceOf(RawSource); expect(result).toEqualInstanceOf(RawSource);
}); });
}); });
}); });
@ -109,7 +109,7 @@ describe("ExternalModule", () => {
const result = externalModule.getSourceForGlobalVariableExternal(varName, type); const result = externalModule.getSourceForGlobalVariableExternal(varName, type);
// check // check
expect(result).toBe(expected); expect(result).toEqual(expected);
}); });
}); });
describe("given an single variable name", () => { describe("given an single variable name", () => {
@ -123,7 +123,7 @@ describe("ExternalModule", () => {
const result = externalModule.getSourceForGlobalVariableExternal(varName, type); const result = externalModule.getSourceForGlobalVariableExternal(varName, type);
// check // check
expect(result).toBe(expected); expect(result).toEqual(expected);
}); });
}); });
}); });
@ -139,7 +139,7 @@ describe("ExternalModule", () => {
const result = externalModule.getSourceForCommonJsExternal(varName, type); const result = externalModule.getSourceForCommonJsExternal(varName, type);
// check // check
expect(result).toBe(expected); expect(result).toEqual(expected);
}); });
}); });
describe("given an single variable name", () => { describe("given an single variable name", () => {
@ -153,7 +153,7 @@ describe("ExternalModule", () => {
const result = externalModule.getSourceForCommonJsExternal(varName, type); const result = externalModule.getSourceForCommonJsExternal(varName, type);
// check // check
expect(result).toBe(expected); expect(result).toEqual(expected);
}); });
}); });
}); });
@ -170,7 +170,7 @@ describe("ExternalModule", () => {
const result = externalModule.checkExternalVariable(variableToCheck, request); const result = externalModule.checkExternalVariable(variableToCheck, request);
// check // check
expect(result).toBe(expected); expect(result).toEqual(expected);
}); });
}); });
@ -185,7 +185,7 @@ describe("ExternalModule", () => {
const result = externalModule.getSourceForAmdOrUmdExternal(id, optional, request); const result = externalModule.getSourceForAmdOrUmdExternal(id, optional, request);
// check // check
expect(result).toBe(expected); expect(result).toEqual(expected);
}); });
describe("given an optinal check is set", () => { describe("given an optinal check is set", () => {
it("ads a check for the existance of the variable before looking it up", () => { 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); const result = externalModule.getSourceForAmdOrUmdExternal(id, optional, request);
// check // 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); const result = externalModule.getSourceForDefaultCase(optional, request);
// check // check
expect(result).toBe(expected); expect(result).toEqual(expected);
}); });
describe("given an optinal check is requested", () => { describe("given an optinal check is requested", () => {
it("checks for the existance of the request setting it", () => { it("checks for the existance of the request setting it", () => {
@ -227,7 +227,7 @@ module.exports = some/request;`;
const result = externalModule.getSourceForDefaultCase(optional, request); const result = externalModule.getSourceForDefaultCase(optional, request);
// check // check
expect(result).toBe(expected); expect(result).toEqual(expected);
}); });
}); });
}); });

View File

@ -263,7 +263,7 @@ describe("MultiStats", () => {
}); });
it("returns string representation", () => { it("returns string representation", () => {
expect(result).toBe( expect(result).toEqual(
"Hash: abc123xyz890\n" + "Hash: abc123xyz890\n" +
"Version: webpack 1.2.3\n" + "Version: webpack 1.2.3\n" +
"Child abc123-compilation:\n" + "Child abc123-compilation:\n" +

View File

@ -16,14 +16,14 @@ define("named4", [], function() {
define(["named1", "named2"], function(named1, named2) { define(["named1", "named2"], function(named1, named2) {
it("should load the named modules in defined dependencies", function() { it("should load the named modules in defined dependencies", function() {
named1.should.be.eql("named1"); expect(named1).toBe("named1");
named2.should.be.eql("named2"); expect(named2).toBe("named2");
}); });
it("should load the named modules in require dependencies", function(done) { it("should load the named modules in require dependencies", function(done) {
require(["named3", "named4"], function (named3, named4) { require(["named3", "named4"], function (named3, named4) {
named3.should.be.eql("named3"); expect(named3).toBe("named3");
named4.should.be.eql("named4"); expect(named4).toBe("named4");
done(); done();
}); });
}); });

View File

@ -16,14 +16,14 @@ define("named4", [], function() {
define("named1,named2".split(","), function(named1, named2) { define("named1,named2".split(","), function(named1, named2) {
it("should load the named modules in const array defined dependencies", function() { it("should load the named modules in const array defined dependencies", function() {
named1.should.be.eql("named1"); expect(named1).toBe("named1");
named2.should.be.eql("named2"); expect(named2).toBe("named2");
}); });
it("should load the named modules in const array require dependencies", function(done) { it("should load the named modules in const array require dependencies", function(done) {
require("named3,named4".split(","), function (named3, named4) { require("named3,named4".split(","), function (named3, named4) {
named3.should.be.eql("named3"); expect(named3).toBe("named3");
named4.should.be.eql("named4"); expect(named4).toBe("named4");
done(); done();
}); });
}); });

View File

@ -2,7 +2,7 @@ it("should handle circular chunks correctly", function(done) {
import(/* webpackChunkName: "a" */"./module-a").then(function(result) { import(/* webpackChunkName: "a" */"./module-a").then(function(result) {
return result.default(); return result.default();
}).then(function(result2) { }).then(function(result2) {
result2.default().should.be.eql("x"); expect(result2.default()).toBe("x");
done(); done();
}).catch(function(e) { }).catch(function(e) {
done(e); done(e);

View File

@ -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() { it("should find module with asyncMode === 'weak' when required elsewhere", function() {
var contextRequire = require.context(".", false, /.+/, "weak"); 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 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() { it("should find module with asyncMode === 'weak' when required elsewhere (recursive)", function() {
var contextRequire = require.context(".", true, /.+/, "weak"); 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 require("./dir/four"); // in a real app would be served as a separate chunk
}); });

View File

@ -1,9 +1,9 @@
it("should also work in a chunk", function(done) { it("should also work in a chunk", function(done) {
require.ensure([], function(require) { require.ensure([], function(require) {
var contextRequire = require.context(".", false, /two/); var contextRequire = require.context(".", false, /two/);
contextRequire("./two").should.be.eql(2); expect(contextRequire("./two")).toBe(2);
var tw = "tw"; var tw = "tw";
require("." + "/" + tw + "o").should.be.eql(2); expect(require("." + "/" + tw + "o")).toBe(2);
done(); done();
}); });
}); });

View File

@ -2,11 +2,11 @@ function testCase(load, done) {
load("two", 2, function() { load("two", 2, function() {
var sync = true; var sync = true;
load("one", 1, function() { load("one", 1, function() {
sync.should.be.eql(false); expect(sync).toBe(false);
load("three", 3, function() { load("three", 3, function() {
var sync = true; var sync = true;
load("two", 2, function() { load("two", 2, function() {
sync.should.be.eql(true); expect(sync).toBe(true);
done(); done();
}); });
Promise.resolve().then(function() {}).then(function() {}).then(function() { 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) { it("should be able to use expressions in import", function(done) {
function load(name, expected, callback) { function load(name, expected, callback) {
import("./dir/" + name).then(function(result) { import("./dir/" + name).then(function(result) {
result.should.be.eql({ default: expected }); expect(result).toEqual({ default: expected });
callback(); callback();
}).catch(function(err) { }).catch(function(err) {
done(err); done(err);

View File

@ -1,6 +1,6 @@
it("should be able to use import", function(done) { it("should be able to use import", function(done) {
import("./two").then(function(two) { import("./two").then(function(two) {
two.should.be.eql({ default: 2 }); expect(two).toEqual({ default: 2 });
done(); done();
}).catch(function(err) { }).catch(function(err) {
done(err); done(err);

View File

@ -106,16 +106,16 @@ function testChunkLoading(load, expectedSyncInitial, expectedSyncRequested) {
var sync = false; var sync = false;
var syncInitial = true; var syncInitial = true;
var p = Promise.all([load("a"), load("b")]).then(function() { var p = Promise.all([load("a"), load("b")]).then(function() {
syncInitial.should.be.eql(expectedSyncInitial); expect(syncInitial).toBe(expectedSyncInitial);
sync = true; sync = true;
var p = Promise.all([ var p = Promise.all([
load("a").then(function(a) { load("a").then(function(a) {
a.should.be.eql({ default: "a" }); expect(a).toEqual({ default: "a" });
sync.should.be.eql(true); expect(sync).toBe(true);
}), }),
load("c").then(function(c) { load("c").then(function(c) {
c.should.be.eql({ default: "c" }); expect(c).toEqual({ default: "c" });
sync.should.be.eql(expectedSyncRequested); expect(sync).toBe(expectedSyncRequested);
}) })
]); ]);
Promise.resolve().then(function(){}).then(function(){}).then(function(){}).then(function(){ Promise.resolve().then(function(){}).then(function(){}).then(function(){}).then(function(){

View File

@ -1,7 +1,7 @@
it("should be able to use expressions in import (directory)", function(done) { it("should be able to use expressions in import (directory)", function(done) {
function load(name, expected, callback) { function load(name, expected, callback) {
import("./dir/" + name + "/file.js").then(function(result) { import("./dir/" + name + "/file.js").then(function(result) {
result.should.be.eql({ default: expected }); expect(result).toEqual({ default: expected });
callback(); callback();
}).catch(function(err) { }).catch(function(err) {
done(err); done(err);

View File

@ -2,11 +2,11 @@ var should = require("should");
it("should handle bound function expressions", function(done) { it("should handle bound function expressions", function(done) {
require.ensure([], function(require) { require.ensure([], function(require) {
this.should.be.eql({ test: true }); expect(this).toEqual({ test: true });
require("./empty?test"); require("./empty?test");
process.nextTick.should.have.type("function"); // check if injection still works process.nextTick.should.have.type("function"); // check if injection still works
require.ensure([], function(require) { require.ensure([], function(require) {
this.should.be.eql({ test: true }); expect(this).toEqual({ test: true });
done(); done();
}.bind(this)); }.bind(this));
}.bind({test: true})); }.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) { it("should parse expression in require.ensure, which isn't a function expression", function(done) {
require.ensure([], (function() { require.ensure([], (function() {
require("./empty?require.ensure:test").should.be.eql({}); expect(require("./empty?require.ensure:test")).toEqual({});
return function f() { return function f() {
done(); done();
}; };
@ -36,7 +36,7 @@ it("should accept a require.include call", function(done) {
}); });
setImmediate(function() { setImmediate(function() {
should.strictEqual(value, "require.include"); should.strictEqual(value, "require.include");
value.should.be.eql("require.include"); expect(value).toBe("require.include");
done(); done();
}); });
}); });

View File

@ -1,3 +1,3 @@
require.ensure(["./a"], function(require) { require.ensure(["./a"], function(require) {
require("./a").should.be.eql("a"); expect(require("./a")).toBe("a");
}) })

View File

@ -1,3 +1,3 @@
require.ensure(["./b"], function(require) { require.ensure(["./b"], function(require) {
require("./b").should.be.eql("a"); expect(require("./b")).toBe("a");
}) })

View File

@ -21,7 +21,7 @@ it("should not load a chunk which is included in a already loaded one", function
var asyncFlag = false; var asyncFlag = false;
require.ensure(["./empty?x", "./empty?y", "./empty?z"], function(require) { require.ensure(["./empty?x", "./empty?y", "./empty?z"], function(require) {
try { try {
asyncFlag.should.be.eql(true); expect(asyncFlag).toBe(true);
loadChunk(); loadChunk();
} catch(e) { } catch(e) {
done(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; var sync = true;
require.ensure(["./empty?x", "./empty?y"], function(require) { require.ensure(["./empty?x", "./empty?y"], function(require) {
try { try {
sync.should.be.eql(true); expect(sync).toBe(true);
done(); done();
} catch(e) { } catch(e) {
done(e); done(e);

View File

@ -18,7 +18,7 @@ it("should not include a module with a weak dependency using context", function(
resolveWeakB.should.exist; resolveWeakB.should.exist;
resolveWeakC.should.exist; resolveWeakC.should.exist;
a.should.be.eql(false); expect(a).toBe(false);
b.should.be.eql(false); expect(b).toBe(false);
c.should.be.eql(true); expect(c).toBe(true);
}); });

View File

@ -6,8 +6,8 @@ it("should not include a module with a weak dependency", function() {
require(["./c"]); require(["./c"]);
require("./d"); require("./d");
a.should.be.eql(false); expect(a).toBe(false);
b.should.be.eql(true); expect(b).toBe(true);
c.should.be.eql(false); expect(c).toBe(false);
d.should.be.eql(true); expect(d).toBe(true);
}); });

View File

@ -1,6 +1,6 @@
it("should handle reference to entry chunk correctly", function(done) { it("should handle reference to entry chunk correctly", function(done) {
import(/* webpackChunkName: "main" */"./module-a").then(function(result) { import(/* webpackChunkName: "main" */"./module-a").then(function(result) {
result.default.should.be.eql("ok"); expect(result.default).toBe("ok");
done(); done();
}).catch(function(e) { }).catch(function(e) {
done(e); done(e);

View File

@ -1,12 +1,12 @@
it("should load a duplicate module with different dependencies correctly", function(done) { it("should load a duplicate module with different dependencies correctly", function(done) {
var a = require("bundle-loader!./a/file"); var a = require("bundle-loader!./a/file");
var b = require("bundle-loader!./b/file"); var b = require("bundle-loader!./b/file");
(typeof a).should.be.eql("function"); expect((typeof a)).toBe("function");
(typeof b).should.be.eql("function"); expect((typeof b)).toBe("function");
a(function(ra) { a(function(ra) {
ra.should.be.eql("a"); expect(ra).toBe("a");
b(function(rb) { b(function(rb) {
rb.should.be.eql("b"); expect(rb).toBe("b");
done(); done();
}) })
}); });

View File

@ -1,6 +1,6 @@
it("should load a duplicate module with different dependencies correctly", function() { it("should load a duplicate module with different dependencies correctly", function() {
var dedupe1 = require("./dedupe1"); var dedupe1 = require("./dedupe1");
var dedupe2 = require("./dedupe2"); var dedupe2 = require("./dedupe2");
dedupe1.should.be.eql("dedupe1"); expect(dedupe1).toBe("dedupe1");
dedupe2.should.be.eql("dedupe2"); expect(dedupe2).toBe("dedupe2");
}); });

View File

@ -1,12 +1,12 @@
it("should resolve the alias in package.json", function() { 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() { 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() { it("should resolve the alias in package.json", function() {
require("thing").default.should.be.eql("the thing"); expect(require("thing").default).toBe("the thing");
}); });

View File

@ -3,5 +3,5 @@ function get(name) {
} }
it("should automatically infer the index.js file", function() { it("should automatically infer the index.js file", function() {
get("module").should.be.eql("module"); expect(get("module")).toBe("module");
}); });

View File

@ -7,7 +7,7 @@ it("should support an empty context", function() {
(function() { (function() {
c(""); c("");
}).should.throw(); }).should.throw();
c.keys().should.be.eql([]); expect(c.keys()).toEqual([]);
}); });
// This would be a useful testcase, but it requires an (really) empty directory. // 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() { (function() {
c(""); c("");
}).should.throw(); }).should.throw();
c.keys().should.be.eql([]); expect(c.keys()).toEqual([]);
});*/ });*/

View File

@ -1,4 +1,4 @@
it("should not use regexps with the g flag", function() { it("should not use regexps with the g flag", function() {
require.context("./folder", true, /a/).keys().length.should.be.eql(1); expect(require.context("./folder", true, /a/).keys().length).toBe(1);
require.context("./folder", true, /a/g).keys().length.should.be.eql(0); expect(require.context("./folder", true, /a/g).keys().length).toBe(0);
}); });

View File

@ -1,7 +1,7 @@
it("should emit valid code for dynamic require string with expr", function() { it("should emit valid code for dynamic require string with expr", function() {
var test = require("./folder/file"); var test = require("./folder/file");
test("file").should.be.eql({ a: false, b: false, c: true, d: true }); expect(test("file")).toEqual({ a: false, b: false, c: true, d: true });
test("file.js").should.be.eql({ a: false, b: false, c: false, d: true }); expect(test("file.js")).toEqual({ a: false, b: false, c: false, d: true });
test("./file").should.be.eql({ a: true, b: true, c: false, d: false }); expect(test("./file")).toEqual({ a: true, b: true, c: false, d: false });
test("./file.js").should.be.eql({ a: false, b: false, c: false, d: false }); expect(test("./file.js")).toEqual({ a: false, b: false, c: false, d: false });
}); });

View File

@ -1,8 +1,8 @@
it("should require json via require", function() { it("should require json via require", function() {
({ data: require("./a.json") }).should.be.eql({ data: null }); ({ data: require("./a.json") }expect()).toEqual({ data: null });
({ data: require("./b.json") }).should.be.eql({ data: 123 }); ({ data: require("./b.json") }expect()).toEqual({ data: 123 });
({ data: require("./c.json") }).should.be.eql({ data: [1, 2, 3, 4] }); ({ data: require("./c.json") }expect()).toEqual({ data: [1, 2, 3, 4] });
({ data: require("./e.json") }).should.be.eql({ data: { ({ data: require("./e.json") }expect()).toEqual({ data: {
"aa": 1, "aa": 1,
"bb": 2, "bb": 2,
"1": "x" "1": "x"

View File

@ -5,12 +5,12 @@ import f, { named } from "../data/f.json";
import g, { named as gnamed } from "../data/g.json"; import g, { named as gnamed } from "../data/g.json";
it("should be possible to import json data", function() { it("should be possible to import json data", function() {
c[2].should.be.eql(3); expect(c[2]).toBe(3);
Object.keys(d).should.be.eql(["default"]); expect(Object.keys(d)).toEqual(["default"]);
aa.should.be.eql(1); expect(aa).toBe(1);
bb.should.be.eql(2); expect(bb).toBe(2);
named.should.be.eql("named"); expect(named).toBe("named");
({ f }).should.be.eql({ ({ f }expect()).toEqual({
f: { f: {
__esModule: true, __esModule: true,
default: "default", default: "default",

View File

@ -6,16 +6,16 @@ import e from "../data/e.json";
import f from "../data/f.json"; import f from "../data/f.json";
it("should be possible to import json data", function() { it("should be possible to import json data", function() {
({a}).should.be.eql({a: null}); ({a}expect()).toEqual({a: null});
b.should.be.eql(123); expect(b).toBe(123);
c.should.be.eql([1, 2, 3, 4]); expect(c).toEqual([1, 2, 3, 4]);
d.should.be.eql({}); expect(d).toEqual({});
e.should.be.eql({ expect(e).toEqual({
aa: 1, aa: 1,
bb: 2, bb: 2,
"1": "x" "1": "x"
}); });
f.should.be.eql({ expect(f).toEqual({
named: "named", named: "named",
"default": "default", "default": "default",
__esModule: true __esModule: true

View File

@ -1,14 +1,14 @@
it("should allow combinations of async and sync loaders", function() { it("should allow combinations of async and sync loaders", function() {
require("./loaders/syncloader!./a").should.be.eql("a"); expect(require("./loaders/syncloader!./a")).toBe("a");
require("./loaders/asyncloader!./a").should.be.eql("a"); expect(require("./loaders/asyncloader!./a")).toBe("a");
require("./loaders/syncloader!./loaders/syncloader!./a").should.be.eql("a"); expect(require("./loaders/syncloader!./loaders/syncloader!./a")).toBe("a");
require("./loaders/syncloader!./loaders/asyncloader!./a").should.be.eql("a"); expect(require("./loaders/syncloader!./loaders/asyncloader!./a")).toBe("a");
require("./loaders/asyncloader!./loaders/syncloader!./a").should.be.eql("a"); expect(require("./loaders/asyncloader!./loaders/syncloader!./a")).toBe("a");
require("./loaders/asyncloader!./loaders/asyncloader!./a").should.be.eql("a"); expect(require("./loaders/asyncloader!./loaders/asyncloader!./a")).toBe("a");
require("./loaders/asyncloader!./loaders/asyncloader!./loaders/asyncloader!./a").should.be.eql("a"); expect(require("./loaders/asyncloader!./loaders/asyncloader!./loaders/asyncloader!./a")).toBe("a");
require("./loaders/asyncloader!./loaders/syncloader!./loaders/asyncloader!./a").should.be.eql("a"); expect(require("./loaders/asyncloader!./loaders/syncloader!./loaders/asyncloader!./a")).toBe("a");
require("./loaders/syncloader!./loaders/asyncloader!./loaders/syncloader!./a").should.be.eql("a"); expect(require("./loaders/syncloader!./loaders/asyncloader!./loaders/syncloader!./a")).toBe("a");
require("./loaders/syncloader!./loaders/syncloader!./loaders/syncloader!./a").should.be.eql("a"); expect(require("./loaders/syncloader!./loaders/syncloader!./loaders/syncloader!./a")).toBe("a");
}); });

View File

@ -1,10 +1,10 @@
it("should handle the coffee loader correctly", function() { it("should handle the coffee loader correctly", function() {
require("!coffee-loader!../_resources/script.coffee").should.be.eql("coffee test"); expect(require("!coffee-loader!../_resources/script.coffee")).toBe("coffee test");
require("../_resources/script.coffee").should.be.eql("coffee test"); expect(require("../_resources/script.coffee")).toBe("coffee test");
}); });
it("should handle literate coffee script correctly", function() { 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() { it("should generate valid code with cheap-source-map", function() {

View File

@ -1,5 +1,5 @@
it("should be able to use a context with a loader", function() { it("should be able to use a context with a loader", function() {
var abc = "abc", scr = "script.coffee"; var abc = "abc", scr = "script.coffee";
require("../_resources/" + scr).should.be.eql("coffee test"); expect(require("../_resources/" + scr)).toBe("coffee test");
require("raw-loader!../_resources/" + abc + ".txt").should.be.eql("abc"); expect(require("raw-loader!../_resources/" + abc + ".txt")).toBe("abc");
}); });

View File

@ -1,4 +1,4 @@
it("should handle the jade loader correctly", function() { it("should handle the jade loader correctly", function() {
require("!jade-loader?self!../_resources/template.jade")({abc: "abc"}).should.be.eql("<p>selfabc</p><h1>included</h1>"); require("!jade-loader?self!../_resources/template.jade")({abc: "abc"}expect()).toBe("<p>selfabc</p><h1>included</h1>");
require("../_resources/template.jade")({abc: "abc"}).should.be.eql("<p>abc</p><h1>included</h1>"); require("../_resources/template.jade")({abc: "abc"}expect()).toBe("<p>abc</p><h1>included</h1>");
}); });

View File

@ -1,12 +1,12 @@
it("should run a loader from package.json", function() { it("should run a loader from package.json", function() {
require("testloader!../_resources/abc.txt").should.be.eql("abcwebpack"); expect(require("testloader!../_resources/abc.txt")).toBe("abcwebpack");
require("testloader/lib/loader2!../_resources/abc.txt").should.be.eql("abcweb"); expect(require("testloader/lib/loader2!../_resources/abc.txt")).toBe("abcweb");
require("testloader/lib/loader3!../_resources/abc.txt").should.be.eql("abcloader"); expect(require("testloader/lib/loader3!../_resources/abc.txt")).toBe("abcloader");
require("testloader/lib/loader-indirect!../_resources/abc.txt").should.be.eql("abcwebpack"); expect(require("testloader/lib/loader-indirect!../_resources/abc.txt")).toBe("abcwebpack");
}); });
it("should run a loader from .webpack-loader.js extension", function() { 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() { 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");
}); });

View File

@ -1,6 +1,6 @@
it("should pass query to loader", function() { it("should pass query to loader", function() {
var result = require("./loaders/queryloader?query!./a?resourcequery"); var result = require("./loaders/queryloader?query!./a?resourcequery");
result.should.be.eql({ expect(result).toEqual({
resourceQuery: "?resourcequery", resourceQuery: "?resourcequery",
query: "?query", query: "?query",
prev: "module.exports = \"a\";" 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() { it("should pass query to loader without resource with resource query", function() {
var result = require("./loaders/queryloader?query!?resourcequery"); var result = require("./loaders/queryloader?query!?resourcequery");
result.should.be.eql({ expect(result).toEqual({
resourceQuery: "?resourcequery", resourceQuery: "?resourcequery",
query: "?query", query: "?query",
prev: null 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() { it("should pass query to loader without resource", function() {
var result = require("./loaders/queryloader?query!"); var result = require("./loaders/queryloader?query!");
result.should.be.eql({ expect(result).toEqual({
query: "?query", query: "?query",
prev: null prev: null
}); });
@ -39,7 +39,7 @@ it("should pass query to multiple loaders", function() {
it("should pass query to loader over context", function() { it("should pass query to loader over context", function() {
var test = "test"; var test = "test";
var result = require("./loaders/queryloader?query!./context-query-test/" + test); var result = require("./loaders/queryloader?query!./context-query-test/" + test);
result.should.be.eql({ expect(result).toEqual({
resourceQuery: "", resourceQuery: "",
query: "?query", query: "?query",
prev: "test content" prev: "test content"

View File

@ -1,3 +1,3 @@
it("should handle the raw loader correctly", function() { 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");
}); });

View File

@ -5,26 +5,26 @@ import { ns, default as def1, def as def2, data as data2 } from "./reexport.mjs"
import * as reexport 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() { it("should get correct values when importing named exports from a CommonJs module from mjs", function() {
(typeof data).should.be.eql("undefined"); expect((typeof data)).toBe("undefined");
({ data }).should.be.eql({ data: undefined }); ({ data }expect()).toEqual({ data: undefined });
def.should.be.eql({ expect(def).toEqual({
data: "ok", data: "ok",
default: "default" default: "default"
}); });
({ def }).should.be.eql({ ({ def }expect()).toEqual({
def: { def: {
data: "ok", data: "ok",
default: "default" default: "default"
} }
}); });
const valueOf = "valueOf"; const valueOf = "valueOf";
star[valueOf]().should.be.eql({ expect(star[valueOf]()).toEqual({
default: { default: {
data: "ok", data: "ok",
default: "default" default: "default"
} }
}); });
({ star }).should.be.eql({ ({ star }expect()).toEqual({
star: { star: {
default: { default: {
data: "ok", 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", data: "ok",
default: "default" default: "default"
}); });
ns.should.be.eql({ expect(ns).toEqual({
default: { default: {
data: "ok", data: "ok",
default: "default" default: "default"
} }
}); });
def1.should.be.eql({ expect(def1).toEqual({
data: "ok", data: "ok",
default: "default" default: "default"
}); });
def2.should.be.eql({ expect(def2).toEqual({
data: "ok", data: "ok",
default: "default" default: "default"
}); });
(typeof data2).should.be.eql("undefined"); expect((typeof data2)).toBe("undefined");
reexport[valueOf]().should.be.eql({ expect(reexport[valueOf]()).toEqual({
ns: { ns: {
default: { default: {
data: "ok", data: "ok",

View File

@ -1,13 +1,13 @@
it("should receive a namespace object when importing commonjs", function(done) { it("should receive a namespace object when importing commonjs", function(done) {
import("./cjs.js").then(function(result) { import("./cjs.js").then(function(result) {
result.should.be.eql({ default: { named: "named", default: "default" } }); expect(result).toEqual({ default: { named: "named", default: "default" } });
done(); done();
}).catch(done); }).catch(done);
}); });
it("should receive a namespace object when importing commonjs with __esModule", function(done) { it("should receive a namespace object when importing commonjs with __esModule", function(done) {
import("./cjs-esmodule.js").then(function(result) { 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(); done();
}).catch(done); }).catch(done);
}); });
@ -54,7 +54,7 @@ function contextMixed(name) {
function promiseTest(promise, equalsTo) { function promiseTest(promise, equalsTo) {
return promise.then(function(results) { return promise.then(function(results) {
for(const result of results) for(const result of results)
result.should.be.eql(equalsTo); expect(result).toEqual(equalsTo);
}); });
} }

View File

@ -1,13 +1,13 @@
it("should receive a namespace object when importing commonjs", function(done) { it("should receive a namespace object when importing commonjs", function(done) {
import("./cjs").then(function(result) { import("./cjs").then(function(result) {
result.should.be.eql({ default: { named: "named", default: "default" } }); expect(result).toEqual({ default: { named: "named", default: "default" } });
done(); done();
}).catch(done); }).catch(done);
}); });
it("should receive a namespace object when importing commonjs with __esModule", function(done) { it("should receive a namespace object when importing commonjs with __esModule", function(done) {
import("./cjs-esmodule").then(function(result) { 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(); done();
}).catch(done); }).catch(done);
}); });
@ -54,7 +54,7 @@ function contextMixed(name) {
function promiseTest(promise, equalsTo) { function promiseTest(promise, equalsTo) {
return promise.then(function(results) { return promise.then(function(results) {
for(const result of results) for(const result of results)
result.should.be.eql(equalsTo); expect(result).toEqual(equalsTo);
}); });
} }

View File

@ -7,7 +7,7 @@ it("should load script with nonce 'nonce1234'", function(done) {
// if in browser context, test that nonce was added. // if in browser context, test that nonce was added.
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
var script = document.querySelector('script[src="js/chunk-with-nonce.web.js"]'); 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; __webpack_nonce__ = undefined;
done(); done();
@ -21,7 +21,7 @@ it("should load script without nonce", function(done) {
// if in browser context, test that nonce was added. // if in browser context, test that nonce was added.
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
var script = document.querySelector('script[src="js/chunk-without-nonce.web.js"]'); 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; __webpack_nonce__ = undefined;
done(); done();

View File

@ -2,6 +2,6 @@ import { log } from "pmodule/tracker";
import { a } from "pmodule"; import { a } from "pmodule";
it("should not evaluate a chain of modules", function() { it("should not evaluate a chain of modules", function() {
a.should.be.eql("a"); expect(a).toBe("a");
log.should.be.eql(["a.js"]); expect(log).toEqual(["a.js"]);
}); });

View File

@ -3,9 +3,9 @@ import { a, x, z } from "pmodule";
import def from "pmodule"; import def from "pmodule";
it("should evaluate all modules", function() { it("should evaluate all modules", function() {
def.should.be.eql("def"); expect(def).toBe("def");
a.should.be.eql("a"); expect(a).toBe("a");
x.should.be.eql("x"); expect(x).toBe("x");
z.should.be.eql("z"); expect(z).toBe("z");
log.should.be.eql(["a.js", "b.js", "c.js", "index.js"]); expect(log).toEqual(["a.js", "b.js", "c.js", "index.js"]);
}); });

View File

@ -2,7 +2,7 @@ import { log } from "pmodule/tracker";
import { a, z } from "pmodule"; import { a, z } from "pmodule";
it("should not evaluate an immediate module", function() { it("should not evaluate an immediate module", function() {
a.should.be.eql("a"); expect(a).toBe("a");
z.should.be.eql("z"); expect(z).toBe("z");
log.should.be.eql(["a.js", "c.js"]); expect(log).toEqual(["a.js", "c.js"]);
}); });

View File

@ -2,5 +2,5 @@ import * as m from "m";
it("should handle unknown exports fine", function() { it("should handle unknown exports fine", function() {
var x = m; var x = m;
x.should.be.eql({ foo: "foo" }); expect(x).toEqual({ foo: "foo" });
}); });

View File

@ -2,8 +2,8 @@ import { log } from "pmodule/tracker";
import { a, x, z } from "pmodule"; import { a, x, z } from "pmodule";
it("should evaluate all modules", function() { it("should evaluate all modules", function() {
a.should.be.eql("a"); expect(a).toBe("a");
x.should.be.eql("x"); expect(x).toBe("x");
z.should.be.eql("z"); expect(z).toBe("z");
log.should.be.eql(["a.js", "b.js", "c.js"]); expect(log).toEqual(["a.js", "b.js", "c.js"]);
}); });

View File

@ -3,8 +3,8 @@ import { x, z } from "pmodule";
import def from "pmodule"; import def from "pmodule";
it("should not evaluate a simple unused module", function() { it("should not evaluate a simple unused module", function() {
def.should.be.eql("def"); expect(def).toBe("def");
x.should.be.eql("x"); expect(x).toBe("x");
z.should.be.eql("z"); expect(z).toBe("z");
log.should.be.eql(["b.js", "c.js", "index.js"]); expect(log).toEqual(["b.js", "c.js", "index.js"]);
}); });

View File

@ -2,7 +2,7 @@ import { log } from "pmodule/tracker";
import { a, y } from "pmodule"; import { a, y } from "pmodule";
it("should not evaluate a reexporting transitive module", function() { it("should not evaluate a reexporting transitive module", function() {
a.should.be.eql("a"); expect(a).toBe("a");
y.should.be.eql("y"); expect(y).toBe("y");
log.should.be.eql(["a.js", "b.js"]); expect(log).toEqual(["a.js", "b.js"]);
}); });

View File

@ -1,5 +1,5 @@
import { test } from "./a"; import { test } from "./a";
it("should correctly tree shake star exports", function() { it("should correctly tree shake star exports", function() {
test.should.be.eql(123); expect(test).toBe(123);
}); });

View File

@ -2,7 +2,7 @@ import { test } from "./a";
import { func1, func3 } from "./x"; import { func1, func3 } from "./x";
it("should correctly tree shake star exports", function() { it("should correctly tree shake star exports", function() {
test.should.be.eql(123); expect(test).toBe(123);
func1().should.be.eql("func1"); expect(func1()).toBe("func1");
func3().should.be.eql("func3"); expect(func3()).toBe("func3");
}); });

View File

@ -3,10 +3,10 @@ import { aa as aa2, d } from "./root3";
var root6 = require("./root6"); var root6 = require("./root6");
it("should correctly tree shake star exports", function() { it("should correctly tree shake star exports", function() {
aa.should.be.eql("aa"); expect(aa).toBe("aa");
aa2.should.be.eql("aa"); expect(aa2).toBe("aa");
d.should.be.eql("d"); expect(d).toBe("d");
root6.should.be.eql({ expect(root6).toEqual({
aa: "aa", aa: "aa",
c: "c" c: "c"
}); });

View File

@ -1,5 +1,5 @@
it("should name require in define correctly", function() { it("should name require in define correctly", function() {
define(["require"], function(require) { define(["require"], function(require) {
(typeof require).should.be.eql("function"); expect((typeof require)).toBe("function");
}); });
}); });

View File

@ -1,9 +1,9 @@
it("should load a utf-8 file with BOM", function() { it("should load a utf-8 file with BOM", function() {
var result = require("./bomfile"); var result = require("./bomfile");
result.should.be.eql("ok"); expect(result).toEqual("ok");
}); });
it("should load a css file with BOM", function() { it("should load a css file with BOM", function() {
var css = require("!css-loader!./bomfile.css") + ""; var css = require("!css-loader!./bomfile.css") + "";
css.should.be.eql("body{color:#abc}"); expect(css).toBe("body{color:#abc}");
}); });

View File

@ -10,5 +10,5 @@ it("should be able to parse browserified modules (UMD)", function() {
},{}]},{},[1]) },{}]},{},[1])
(1) (1)
}); });
module.exports.should.be.eql(1234); expect(module.exports).toBe(1234);
}); });

View File

@ -1,7 +1,7 @@
it("should parse a Coffeescript style function expression in require.ensure", function(done) { it("should parse a Coffeescript style function expression in require.ensure", function(done) {
require.ensure([], (function(_this) { require.ensure([], (function(_this) {
return function(require) { return function(require) {
require("./file").should.be.eql("ok"); expect(require("./file")).toBe("ok");
done(); done();
}; };
}(this))); }(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) { it("should parse a bound function expression in require.ensure", function(done) {
require.ensure([], function(require) { require.ensure([], function(require) {
require("./file").should.be.eql("ok"); expect(require("./file")).toBe("ok");
done(); done();
}.bind(this)); }.bind(this));
}); });
it("should parse a string in require.ensure", function(done) { it("should parse a string in require.ensure", function(done) {
require.ensure("./file", function(require) { require.ensure("./file", function(require) {
require("./file").should.be.eql("ok"); expect(require("./file")).toBe("ok");
done(); done();
}); });
}); });
it("should parse a string in require.ensure with arrow function expression", function(done) { it("should parse a string in require.ensure with arrow function expression", function(done) {
require.ensure("./file", require => { require.ensure("./file", require => {
require("./file").should.be.eql("ok"); expect(require("./file")).toBe("ok");
done(); done();
}); });
}); });
it("should parse a string in require.ensure with arrow function array expression", function(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()));
}); });

View File

@ -1,12 +1,12 @@
import X, { A, B } from "./module"; import X, { A, B } from "./module";
it("should parse classes", function() { it("should parse classes", function() {
new X().a.should.be.eql("ok"); expect(new X().a).toBe("ok");
new A().a.should.be.eql("ok"); expect(new A().a).toBe("ok");
new B().a.should.be.eql("ok"); expect(new B().a).toBe("ok");
}); });
it("should parse methods", function() { it("should parse methods", function() {
new X().b().should.be.eql("ok"); expect(new X().b()).toBe("ok");
X.c().should.be.eql("ok"); expect(X.c()).toBe("ok");
}); });

View File

@ -1,28 +1,28 @@
it("should be able to load a file with the require.context method", function() { it("should be able to load a file with the require.context method", function() {
require.context("./templates")("./tmpl").should.be.eql("test template"); expect(require.context("./templates")("./tmpl")).toBe("test template");
(require.context("./././templates"))("./tmpl").should.be.eql("test template"); expect((require.context("./././templates"))("./tmpl")).toBe("test template");
(require.context("././templates/.")("./tmpl")).should.be.eql("test template"); expect((require.context("././templates/.")("./tmpl"))).toBe("test template");
require.context("./loaders/queryloader?dog=bark!./templates?cat=meow")("./tmpl").should.be.eql({ expect(require.context("./loaders/queryloader?dog=bark!./templates?cat=meow")("./tmpl")).toEqual({
resourceQuery: "?cat=meow", resourceQuery: "?cat=meow",
query: "?dog=bark", query: "?dog=bark",
prev: "module.exports = \"test template\";" prev: "module.exports = \"test template\";"
}); });
require . context ( "." + "/." + "/" + "templ" + "ates" ) ( "./subdir/tmpl.js" ).should.be.eql("subdir test template"); expect(require . context ( "." + "/." + "/" + "templ" + "ates" ) ( "./subdir/tmpl.js" )).toBe("subdir test template");
require.context("./templates", true, /./)("xyz").should.be.eql("xyz"); expect(require.context("./templates", true, /./)("xyz")).toBe("xyz");
}); });
it("should automatically create contexts", function() { it("should automatically create contexts", function() {
var template = "tmpl", templateFull = "./tmpl.js"; var template = "tmpl", templateFull = "./tmpl.js";
var mp = "mp", tmp = "tmp", mpl = "mpl"; var mp = "mp", tmp = "tmp", mpl = "mpl";
require("./templates/" + template).should.be.eql("test template"); expect(require("./templates/" + template)).toBe("test template");
require("./templates/" + tmp + "l").should.be.eql("test template"); expect(require("./templates/" + tmp + "l")).toBe("test template");
require("./templates/t" + mpl).should.be.eql("test template"); expect(require("./templates/t" + mpl)).toBe("test template");
require("./templates/t" + mp + "l").should.be.eql("test template"); expect(require("./templates/t" + mp + "l")).toBe("test template");
}); });
it("should be able to require.resolve with automatical context", function() { it("should be able to require.resolve with automatical context", function() {
var template = "tmpl"; 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() { 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 = function () {};
require("fail"); require("fail");
var template = "tmpl"; 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() { it("should compile an empty context", function() {

View File

@ -19,21 +19,21 @@ it("should parse classes", function() {
var x = new MyClass(); var x = new MyClass();
x.a.should.be.eql("a"); expect(x.a).toBe("a");
x.func().should.be.eql("b"); expect(x.func()).toBe("b");
x.c().should.be.eql("c"); expect(x.c()).toBe("c");
}); });
it("should parse spread operator"/*, function() { it("should parse spread operator"/*, function() {
[0, ...require("./array")].should.be.eql([0, 1, 2, 3]); expect([0, ...require("./array")]).toEqual([0, 1, 2, 3]);
({z: 0, ...require("./object")}).should.be.eql({z: 0, a: 1, b: 2, c: 3}); ({z: 0, ...require("./object")}expect()).toEqual({z: 0, a: 1, b: 2, c: 3});
}*/); }*/);
it("should parse arrow function", function() { it("should parse arrow function", function() {
(() => require("./a"))().should.be.eql("a"); (() =>expect( require("./a"))()).toBe("a");
(() => { (() => {
return require("./a"); return require("./a");
})().should.be.eql("a"); }expect()()).toBe("a");
require.ensure([], () => { require.ensure([], () => {
require("./a"); require("./a");
}); });
@ -53,8 +53,8 @@ it("should parse template literals", function() {
} }
var x = `a${require("./b")}c`; var x = `a${require("./b")}c`;
var y = tag`a${require("./b")}c`; var y = tag`a${require("./b")}c`;
x.should.be.eql("abc"); expect(x).toBe("abc");
y.should.be.eql("b"); expect(y).toBe("b");
}) })
it("should parse generators and yield", function() { it("should parse generators and yield", function() {
@ -63,7 +63,7 @@ it("should parse generators and yield", function() {
yield require("./b"); yield require("./b");
} }
var x = gen(); var x = gen();
x.next().value.should.be.eql("a"); expect(x.next().value).toBe("a");
x.next().value.should.be.eql("b"); expect(x.next().value).toBe("b");
x.next().done.should.be.eql(true); expect(x.next().done).toBe(true);
}) })

View File

@ -7,7 +7,7 @@ it("should evaluate null", function() {
if("shouldn't evaluate expression", function() { if("shouldn't evaluate expression", function() {
var value = ""; var value = "";
var x = (value + "") ? "fail" : "ok"; var x = (value + "") ? "fail" : "ok";
x.should.be.eql("ok"); expect(x).toBe("ok");
}); });
it("should short-circut evaluating", function() { 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() { it("should evaluate __dirname and __resourceQuery with replace and substr", function() {
var result = require("./resourceQuery/index?" + __dirname); var result = require("./resourceQuery/index?" + __dirname);
result.should.be.eql("?resourceQuery"); expect(result).toEqual("?resourceQuery");
}); });

View File

@ -20,36 +20,36 @@ it("should parse fancy function calls with arrow functions", function() {
it("should parse fancy AMD calls with arrow functions", function() { it("should parse fancy AMD calls with arrow functions", function() {
require("./constructor ./a".split(" ")); require("./constructor ./a".split(" "));
require("-> module module exports *constructor *a".replace("module", "require").substr(3).replace(/\*/g, "./").split(" "), (require, module, exports, constructor, a) => { 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"); expect((typeof require)).toBe("function");
(typeof module).should.be.eql("object"); expect((typeof module)).toBe("object");
(typeof exports).should.be.eql("object"); expect((typeof exports)).toBe("object");
(typeof require("./constructor")).should.be.eql("function"); expect((typeof require("./constructor"))).toBe("function");
(typeof constructor).should.be.eql("function"); expect((typeof constructor)).toBe("function");
a.should.be.eql("a"); expect(a).toBe("a");
}); });
define("-> module module exports *constructor *a".replace("module", "require").substr(3).replace(/\*/g, "./").split(" "), (require, module, exports, constructor, 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"); expect((typeof require)).toBe("function");
(typeof module).should.be.eql("object"); expect((typeof module)).toBe("object");
(typeof exports).should.be.eql("object"); expect((typeof exports)).toBe("object");
(typeof require("./constructor")).should.be.eql("function"); expect((typeof require("./constructor"))).toBe("function");
(typeof constructor).should.be.eql("function"); expect((typeof constructor)).toBe("function");
a.should.be.eql("a"); expect(a).toBe("a");
}); });
}); });
it("should be able to use AMD-style require with arrow functions", function(done) { it("should be able to use AMD-style require with arrow functions", function(done) {
var template = "b"; var template = "b";
require(["./circular", "./templates/" + template, true ? "./circular" : "fail"], (circular, testTemplate, circular2) => { require(["./circular", "./templates/" + template, true ? "./circular" : "fail"], (circular, testTemplate, circular2) => {
circular.should.be.eql(1); expect(circular).toBe(1);
circular2.should.be.eql(1); expect(circular2).toBe(1);
testTemplate.should.be.eql("b"); expect(testTemplate).toBe("b");
done(); done();
}); });
}); });
it("should be able to use require.js-style define with arrow functions", function(done) { it("should be able to use require.js-style define with arrow functions", function(done) {
define("name", ["./circular"], (circular) => { define("name", ["./circular"], (circular) => {
circular.should.be.eql(1); expect(circular).toBe(1);
done(); 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) { it("should be able to use require.js-style define, special string, with arrow function", function(done) {
define(["require"], (require) => { define(["require"], (require) => {
require("./circular").should.be.eql(1); expect(require("./circular")).toBe(1);
done(); done();
}); });
}); });
it("should be able to use require.js-style define, without name, with arrow function", function(done) { it("should be able to use require.js-style define, without name, with arrow function", function(done) {
true && define(["./circular"], (circular) => { true && define(["./circular"], (circular) => {
circular.should.be.eql(1); expect(circular).toBe(1);
done(); done();
}); });
}); });
@ -91,17 +91,17 @@ it("should offer AMD-style define for CommonJs with arrow function", function(do
var _test_exports = exports; var _test_exports = exports;
var _test_module = module; var _test_module = module;
define((require, exports, module) => { define((require, exports, module) => {
(typeof require).should.be.eql("function"); expect((typeof require)).toBe("function");
exports.should.be.equal(_test_exports); exports.should.be.equal(_test_exports);
module.should.be.equal(_test_module); module.should.be.equal(_test_module);
require("./circular").should.be.eql(1); expect(require("./circular")).toBe(1);
done(); done();
}); });
}); });
it("should pull in all dependencies of an AMD module with arrow function", function(done) { it("should pull in all dependencies of an AMD module with arrow function", function(done) {
define((require) => { define((require) => {
require("./amdmodule").should.be.eql("a"); expect(require("./amdmodule")).toBe("a");
done(); 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) { it("should create a chunk for require.js require, with arrow function", function(done) {
var sameTick = true; var sameTick = true;
require(["./c"], (c) => { require(["./c"], (c) => {
sameTick.should.be.eql(false); expect(sameTick).toBe(false);
c.should.be.eql("c"); expect(c).toBe("c");
require("./d").should.be.eql("d"); expect(require("./d")).toBe("d");
done(); done();
}); });
sameTick = false; sameTick = false;

View File

@ -20,36 +20,36 @@ it("should parse fancy function calls", function() {
it("should parse fancy AMD calls", function() { it("should parse fancy AMD calls", function() {
require("./constructor ./a".split(" ")); require("./constructor ./a".split(" "));
require("-> module module exports *constructor *a".replace("module", "require").substr(3).replace(/\*/g, "./").split(" "), function(require, module, exports, constructor, a) { 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"); expect((typeof require)).toBe("function");
(typeof module).should.be.eql("object"); expect((typeof module)).toBe("object");
(typeof exports).should.be.eql("object"); expect((typeof exports)).toBe("object");
(typeof require("./constructor")).should.be.eql("function"); expect((typeof require("./constructor"))).toBe("function");
(typeof constructor).should.be.eql("function"); expect((typeof constructor)).toBe("function");
a.should.be.eql("a"); expect(a).toBe("a");
}); });
define("-> module module exports *constructor *a".replace("module", "require").substr(3).replace(/\*/g, "./").split(" "), function(require, module, exports, constructor, 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"); expect((typeof require)).toBe("function");
(typeof module).should.be.eql("object"); expect((typeof module)).toBe("object");
(typeof exports).should.be.eql("object"); expect((typeof exports)).toBe("object");
(typeof require("./constructor")).should.be.eql("function"); expect((typeof require("./constructor"))).toBe("function");
(typeof constructor).should.be.eql("function"); expect((typeof constructor)).toBe("function");
a.should.be.eql("a"); expect(a).toBe("a");
}); });
}); });
it("should be able to use AMD-style require", function(done) { it("should be able to use AMD-style require", function(done) {
var template = "b"; var template = "b";
require(["./circular", "./templates/" + template, true ? "./circular" : "fail"], function(circular, testTemplate, circular2) { require(["./circular", "./templates/" + template, true ? "./circular" : "fail"], function(circular, testTemplate, circular2) {
circular.should.be.eql(1); expect(circular).toBe(1);
circular2.should.be.eql(1); expect(circular2).toBe(1);
testTemplate.should.be.eql("b"); expect(testTemplate).toBe("b");
done(); done();
}); });
}); });
it("should be able to use require.js-style define", function(done) { it("should be able to use require.js-style define", function(done) {
define("name", ["./circular"], function(circular) { define("name", ["./circular"], function(circular) {
circular.should.be.eql(1); expect(circular).toBe(1);
done(); 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) { it("should be able to use require.js-style define, special string", function(done) {
define(["require"], function(require) { define(["require"], function(require) {
require("./circular").should.be.eql(1); expect(require("./circular")).toBe(1);
done(); done();
}); });
}); });
it("should be able to use require.js-style define, without name", function(done) { it("should be able to use require.js-style define, without name", function(done) {
true && define(["./circular"], function(circular) { true && define(["./circular"], function(circular) {
circular.should.be.eql(1); expect(circular).toBe(1);
done(); done();
}); });
}); });
@ -120,10 +120,10 @@ it("should offer AMD-style define for CommonJs", function(done) {
var _test_exports = exports; var _test_exports = exports;
var _test_module = module; var _test_module = module;
define(function(require, exports, module) { define(function(require, exports, module) {
(typeof require).should.be.eql("function"); expect((typeof require)).toBe("function");
exports.should.be.equal(_test_exports); exports.should.be.equal(_test_exports);
module.should.be.equal(_test_module); module.should.be.equal(_test_module);
require("./circular").should.be.eql(1); expect(require("./circular")).toBe(1);
done(); 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) { it("should be able to use AMD require without function expression", function(done) {
require(["./circular"], fn); require(["./circular"], fn);
function fn(c) { function fn(c) {
c.should.be.eql(1); expect(c).toBe(1);
done(); 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) { it("should create a chunk for require.js require", function(done) {
var sameTick = true; var sameTick = true;
require(["./c"], function(c) { require(["./c"], function(c) {
sameTick.should.be.eql(false); expect(sameTick).toBe(false);
c.should.be.eql("c"); expect(c).toBe("c");
require("./d").should.be.eql("d"); expect(require("./d")).toBe("d");
done(); done();
}); });
sameTick = false; sameTick = false;
@ -170,34 +170,34 @@ it("should not fail #138", function(done) {
it("should parse a bound function expression 1", function(done) { it("should parse a bound function expression 1", function(done) {
define(function(a, require, exports, module) { define(function(a, require, exports, module) {
a.should.be.eql(123); expect(a).toBe(123);
(typeof require).should.be.eql("function"); expect((typeof require)).toBe("function");
require("./a").should.be.eql("a"); expect(require("./a")).toBe("a");
done(); done();
}.bind(null, 123)); }.bind(null, 123));
}); });
it("should parse a bound function expression 2", function(done) { it("should parse a bound function expression 2", function(done) {
define("name", function(a, require, exports, module) { define("name", function(a, require, exports, module) {
a.should.be.eql(123); expect(a).toBe(123);
(typeof require).should.be.eql("function"); expect((typeof require)).toBe("function");
require("./a").should.be.eql("a"); expect(require("./a")).toBe("a");
done(); done();
}.bind(null, 123)); }.bind(null, 123));
}); });
it("should parse a bound function expression 3", function(done) { it("should parse a bound function expression 3", function(done) {
define(["./a"], function(number, a) { define(["./a"], function(number, a) {
number.should.be.eql(123); expect(number).toBe(123);
a.should.be.eql("a"); expect(a).toBe("a");
done(); done();
}.bind(null, 123)); }.bind(null, 123));
}); });
it("should parse a bound function expression 4", function(done) { it("should parse a bound function expression 4", function(done) {
define("name", ["./a"], function(number, a) { define("name", ["./a"], function(number, a) {
number.should.be.eql(123); expect(number).toBe(123);
a.should.be.eql("a"); expect(a).toBe("a");
done(); done();
}.bind(null, 123)); }.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() { it("should not fail issue #138 second", function() {
(function(define, global) { 'use strict'; (function(define, global) { 'use strict';
define(function (require) { define(function (require) {
(typeof require).should.be.eql("function"); expect((typeof require)).toBe("function");
require("./a").should.be.eql("a"); expect(require("./a")).toBe("a");
return "#138 2."; return "#138 2.";
}); });
})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); }, this); })(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() { it("should parse an define with empty array and object", function() {
var obj = {ok: 95476}; var obj = {ok: 95476};
define([], obj); define([], obj);
module.exports.should.be.eql(obj); expect(module.exports).toBe(obj);
}); });
it("should parse an define with object", function() { it("should parse an define with object", function() {
var obj = {ok: 76243}; var obj = {ok: 76243};
define(obj); define(obj);
module.exports.should.be.eql(obj); expect(module.exports).toBe(obj);
}); });

View File

@ -1,13 +1,13 @@
var should = require("should"); var should = require("should");
function testCase(number) { 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( require(
number === 1 ? "./folder/file1" : number === 1 ? "./folder/file1" :
number === 2 ? "./folder/file2" : number === 2 ? "./folder/file2" :
number === 3 ? "./folder/file3" : number === 3 ? "./folder/file3" :
"./missingModule" "./missingModule"
).should.be.eql("file" + number); expect()).toBe("file" + number);
} }
it("should parse complex require calls", function() { 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() { 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) { function testFunc(abc, require) {
return require; return require;
} }
testFunc(333, 678).should.be.eql(678); expect(testFunc(333, 678)).toBe(678);
(function() { (function() {
var require = 123; var require = 123;
require.should.be.eql(123); expect(require).toBe(123);
}()); }());
(function() { (function() {
function require() { function require() {
return 123; return 123;
}; };
require("error").should.be.eql(123); expect(require("error")).toBe(123);
}()); }());
(function() { (function() {
var module = 1233; var module = 1233;
module.should.be.eql(1233); expect(module).toBe(1233);
}()); }());
}); });

View File

@ -1,4 +1,4 @@
it("should result in a warning when using module.exports in harmony module", function() { it("should result in a warning when using module.exports in harmony module", function() {
var x = require("./module1"); var x = require("./module1");
x.should.be.eql({default: 1234}); expect(x).toEqual({default: 1234});
}); });

View File

@ -4,9 +4,9 @@ import "./module";
module.exports = 1; module.exports = 1;
}).should.throw(); }).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() { (function() {
define(function() {}) define(function() {})
}).should.throw(/define is not defined/); }).should.throw(/define is not defined/);
@ -15,5 +15,5 @@ export default 1234;
if(eval("typeof exports !== \"undefined\"")) { if(eval("typeof exports !== \"undefined\"")) {
// exports is node.js exports and not webpacks // exports is node.js exports and not webpacks
Object.keys(exports).should.be.eql([]); expect(Object.keys(exports)).toEqual([]);
} }

View File

@ -2,7 +2,7 @@ import { x, y } from "./b";
it("should pass when required by CommonJS module", function () { it("should pass when required by CommonJS module", function () {
var test1 = require('./a').default; var test1 = require('./a').default;
test1().should.be.eql("OK"); expect(test1()).toBe("OK");
}); });
it("should pass when use babeljs transpiler", function() { it("should pass when use babeljs transpiler", function() {
@ -13,18 +13,18 @@ it("should pass when use babeljs transpiler", function() {
var _test2 = _interopRequireDefault(_test); var _test2 = _interopRequireDefault(_test);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var test2 = (0, _test2.default)(); var test2 = (0, _test2.default)();
test2.should.be.eql("OK"); expect(test2).toBe("OK");
}); });
it("should double reexport from non-harmony modules correctly", function() { it("should double reexport from non-harmony modules correctly", function() {
y.should.be.eql("y"); expect(y).toBe("y");
x.should.be.eql("x"); expect(x).toBe("x");
}); });
import { a, b } from "./reexport" import { a, b } from "./reexport"
it("should be possible to reexport a module with unknown exports", function() { it("should be possible to reexport a module with unknown exports", function() {
a.should.be.eql("a"); expect(a).toBe("a");
b.should.be.eql("b"); expect(b).toBe("b");
}); });

View File

@ -15,21 +15,21 @@ var y6 = require("./6?b").x;
var y7 = require("./7?b").x; var y7 = require("./7?b").x;
it("should not overwrite when using star export (known exports)", function() { it("should not overwrite when using star export (known exports)", function() {
x1.should.be.eql("1"); expect(x1).toBe("1");
x2.should.be.eql("1"); expect(x2).toBe("1");
x3.should.be.eql("a"); expect(x3).toBe("a");
x4.should.be.eql("b"); expect(x4).toBe("b");
x5.should.be.eql("c"); expect(x5).toBe("c");
x6.should.be.eql("a"); expect(x6).toBe("a");
x7.should.be.eql("d"); expect(x7).toBe("d");
}); });
it("should not overwrite when using star export (unknown exports)", function() { it("should not overwrite when using star export (unknown exports)", function() {
y1.should.be.eql("1"); expect(y1).toBe("1");
y2.should.be.eql("1"); expect(y2).toBe("1");
y3.should.be.eql("a"); expect(y3).toBe("a");
y4.should.be.eql("b"); expect(y4).toBe("b");
y5.should.be.eql("c"); expect(y5).toBe("c");
y6.should.be.eql("a"); expect(y6).toBe("a");
y7.should.be.eql("d"); expect(y7).toBe("d");
}); });

View File

@ -3,9 +3,9 @@ import x, { b } from "./b";
import { c, d } from "./fake-reexport"; import { c, d } from "./fake-reexport";
it("should be able to use exported function", function() { it("should be able to use exported function", function() {
a.should.be.eql("ok"); expect(a).toBe("ok");
b.should.be.eql("ok"); expect(b).toBe("ok");
x().should.be.eql("ok"); expect(x()).toBe("ok");
c.should.be.eql("ok"); expect(c).toBe("ok");
d.should.be.eql("ok"); expect(d).toBe("ok");
}); });

View File

@ -4,6 +4,6 @@ it("should hoist exports", function() {
var result = require("./foo").default; var result = require("./foo").default;
(typeof result.foo).should.have.eql("function"); (typeof result.foo).should.have.eql("function");
(typeof result.foo2).should.have.eql("function"); (typeof result.foo2).should.have.eql("function");
result.foo().should.be.eql("ok"); expect(result.foo()).toBe("ok");
result.foo2().should.be.eql("ok"); expect(result.foo2()).toBe("ok");
}); });

View File

@ -3,19 +3,19 @@ import { a, b, c, d, e } from "./a";
import defaultImport from "./a"; import defaultImport from "./a";
it("should prefer local exports", function() { it("should prefer local exports", function() {
a().should.be.eql("a1"); expect(a()).toBe("a1");
e.should.be.eql("e1"); expect(e).toBe("e1");
}); });
it("should prefer indirect exports over star exports", function() { it("should prefer indirect exports over star exports", function() {
b.should.be.eql("b2"); expect(b).toBe("b2");
d.should.be.eql("d2"); expect(d).toBe("d2");
}); });
it("should use star exports", function() { it("should use star exports", function() {
c.should.be.eql("c3"); expect(c).toBe("c3");
}); });
it("should not export default via star export", function() { it("should not export default via star export", function() {
(typeof defaultImport).should.be.eql("undefined"); expect((typeof defaultImport)).toBe("undefined");
}); });

View File

@ -3,8 +3,8 @@ it("should process imports of star exports in the correct order", function() {
tracker.list.length = 0; tracker.list.length = 0;
delete require.cache[require.resolve("./c")]; delete require.cache[require.resolve("./c")];
var c = require("./c"); var c = require("./c");
tracker.list.should.be.eql(["a", "b", "c"]); expect(tracker.list).toEqual(["a", "b", "c"]);
c.ax.should.be.eql("ax"); expect(c.ax).toBe("ax");
c.bx.should.be.eql("ax"); expect(c.bx).toBe("ax");
c.cx.should.be.eql("ax"); expect(c.cx).toBe("ax");
}); });

View File

@ -1,9 +1,9 @@
import {x, f} from "./x"; import {x, f} from "./x";
it("should import into object literal", function() { it("should import into object literal", function() {
({ x: x }).should.be.eql({x: 1}); ({ x: x }expect()).toEqual({x: 1});
var obj = { x: x }; var obj = { x: x };
obj.should.be.eql({x: 1}); expect(obj).toEqual({x: 1});
}); });
function func(z) { function func(z) {
@ -11,21 +11,21 @@ function func(z) {
} }
it("should import into function argument", function() { it("should import into function argument", function() {
func(x).should.be.eql(1); expect(func(x)).toBe(1);
f(x).should.be.eql(1); expect(f(x)).toBe(1);
func({x:x}).should.be.eql({x:1}); func({x:x}expect()).toEqual({x:1});
f({x:x}).should.be.eql({x:1}); f({x:x}expect()).toEqual({x:1});
var y = f(x); var y = f(x);
y.should.be.eql(1); expect(y).toBe(1);
y = function() { y = function() {
return x; return x;
}; };
y().should.be.eql(1); expect(y()).toBe(1);
}); });
it("should import into array literal", function() { it("should import into array literal", function() {
([x, f(2)]).should.be.eql([1, 2]); expect(([x, f(2)])).toEqual([1, 2]);
([{ ([{
value: x value: x
}]).should.be.eql([{ value: x }]); }expect(])).toEqual([{ value: x }]);
}); });

View File

@ -1,3 +1,3 @@
it("should inject variables before exporting", function() { it("should inject variables before exporting", function() {
require("./file").f().should.be.eql({}); expect(require("./file").f()).toEqual({});
}); });

View File

@ -6,33 +6,33 @@ import cycleValue from "./export-cycle-a";
import { data } from "./self-cycle"; import { data } from "./self-cycle";
it("should establish live binding of values", function() { it("should establish live binding of values", function() {
value.should.be.eql(0); expect(value).toBe(0);
add(2); add(2);
value.should.be.eql(2); expect(value).toBe(2);
}); });
it("should establish live binding of values with transpiled es5 module", function() { it("should establish live binding of values with transpiled es5 module", function() {
value2.should.be.eql(0); expect(value2).toBe(0);
add2(5); add2(5);
value2.should.be.eql(5); expect(value2).toBe(5);
}); });
it("should allow to use eval with exports", function() { it("should allow to use eval with exports", function() {
valueEval.should.be.eql(0); expect(valueEval).toBe(0);
evalInModule("value = 5"); evalInModule("value = 5");
valueEval.should.be.eql(5); expect(valueEval).toBe(5);
}); });
it("should execute modules in the correct order", function() { 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() { 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() { 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"; import { value as valueEval, evalInModule } from "./eval";

View File

@ -1,8 +1,8 @@
import value, { exception } from "./module"; import value, { exception } from "./module";
it("should have a TDZ for exported const values", function() { 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.should.be.instanceof(Error);
exception.message.should.match(/ is not defined$/); exception.message.should.match(/ is not defined$/);
value.should.be.eql("value"); expect(value).toBe("value");
}); });

View File

@ -7,11 +7,11 @@ import * as abc from "./abc";
function x() { throw new Error("should not be executed"); } function x() { throw new Error("should not be executed"); }
it("should have this = undefined on imported non-strict functions", function() { it("should have this = undefined on imported non-strict functions", function() {
x x
d().should.be.eql("undefined"); expect(d()).toBe("undefined");
x x
a().should.be.eql("undefined"); expect(a()).toBe("undefined");
x x
B().should.be.eql("undefined"); expect(B()).toBe("undefined");
}); });
import C2, { C } from "./new"; import C2, { C } from "./new";

View File

@ -26,62 +26,62 @@ import "unused";
it("should import a default export from a module", function() { 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() { it("should import an identifier from a module", function() {
a.should.be.eql("a"); expect(a).toBe("a");
B.should.be.eql("b"); expect(B).toBe("b");
}); });
it("should import a whole module", function() { it("should import a whole module", function() {
abc.a.should.be.eql("a"); expect(abc.a).toBe("a");
abc.b.should.be.eql("b"); expect(abc.b).toBe("b");
abc.c.should.be.eql("c"); expect(abc.c).toBe("c");
abc.d.c.should.be.eql("c"); expect(abc.d.c).toBe("c");
abc.e.should.be.eql("c"); expect(abc.e).toBe("c");
var copy = (function(a) { return a; }(abc)); var copy = (function(a) { return a; }(abc));
copy.a.should.be.eql("a"); expect(copy.a).toBe("a");
copy.b.should.be.eql("b"); expect(copy.b).toBe("b");
copy.c.should.be.eql("c"); expect(copy.c).toBe("c");
copy.d.c.should.be.eql("c"); expect(copy.d.c).toBe("c");
copy.e.should.be.eql("c"); expect(copy.e).toBe("c");
(typeof abc).should.be.eql("object"); expect((typeof abc)).toBe("object");
}); });
it("should export functions", function() { it("should export functions", function() {
fn.should.have.type("function"); fn.should.have.type("function");
fn().should.be.eql("fn"); expect(fn()).toBe("fn");
(fn === fn).should.be.eql(true); expect((fn === fn)).toBe(true);
}); });
it("should multiple variables with one statement", function() { it("should multiple variables with one statement", function() {
one.should.be.eql("one"); expect(one).toBe("one");
two.should.be.eql("two"); expect(two).toBe("two");
}); });
it("should still be able to use exported stuff", function() { it("should still be able to use exported stuff", function() {
test1.should.be.eql("fn"); expect(test1).toBe("fn");
test2.should.be.eql("two"); expect(test2).toBe("two");
}); });
it("should reexport a module", function() { it("should reexport a module", function() {
rea.should.be.eql("a"); expect(rea).toBe("a");
reb.should.be.eql("b"); expect(reb).toBe("b");
rec.should.be.eql("c"); expect(rec).toBe("c");
reo.should.be.eql("one"); expect(reo).toBe("one");
retwo.should.be.eql("two"); expect(retwo).toBe("two");
rea2.should.be.eql("a"); expect(rea2).toBe("a");
}); });
it("should support circular dependencies", function() { it("should support circular dependencies", function() {
threeIsOdd.should.be.eql(true); expect(threeIsOdd).toBe(true);
even(4).should.be.eql(true); expect(even(4)).toBe(true);
}); });
it("should support export specifier", function() { it("should support export specifier", function() {
specA.should.be.eql(1); expect(specA).toBe(1);
specB.should.be.eql(2); expect(specB).toBe(2);
}); });
it("should be able to import commonjs", function() { it("should be able to import commonjs", function() {
@ -90,25 +90,25 @@ it("should be able to import commonjs", function() {
x x
Thing.should.have.type("function"); Thing.should.have.type("function");
x x
Thing().should.be.eql("thing"); expect(Thing()).toBe("thing");
x x
Other.should.be.eql("other"); expect(Other).toBe("other");
Thing2.should.have.type("function"); Thing2.should.have.type("function");
new Thing2().value.should.be.eql("thing"); expect(new Thing2().value).toBe("thing");
Other2.should.be.eql("other"); expect(Other2).toBe("other");
Thing3().should.be.eql("thing"); expect(Thing3()).toBe("thing");
}); });
it("should be able to import commonjs with star import", function() { it("should be able to import commonjs with star import", function() {
var copyOfCommonjs = commonjs; var copyOfCommonjs = commonjs;
commonjs().should.be.eql("thing"); expect(commonjs()).toBe("thing");
commonjs.Other.should.be.eql("other"); expect(commonjs.Other).toBe("other");
copyOfCommonjs().should.be.eql("thing"); expect(copyOfCommonjs()).toBe("thing");
copyOfCommonjs.Other.should.be.eql("other"); expect(copyOfCommonjs.Other).toBe("other");
var copyOfCommonjsTrans = commonjsTrans; var copyOfCommonjsTrans = commonjsTrans;
new commonjsTrans.default().value.should.be.eql("thing"); expect(new commonjsTrans.default().value).toBe("thing");
commonjsTrans.Other.should.be.eql("other"); expect(commonjsTrans.Other).toBe("other");
new copyOfCommonjsTrans.default().value.should.be.eql("thing"); expect(new copyOfCommonjsTrans.default().value).toBe("thing");
copyOfCommonjsTrans.Other.should.be.eql("other"); expect(copyOfCommonjsTrans.Other).toBe("other");
}); });

View File

@ -1,18 +1,18 @@
it("should inject the module object into a chunk (AMD1)", function(done) { it("should inject the module object into a chunk (AMD1)", function(done) {
require([], function() { require([], function() {
module.webpackPolyfill.should.be.eql(1); expect(module.webpackPolyfill).toBe(1);
done(); done();
}); });
}); });
it("should inject the module object into a chunk (AMD2)", function() { it("should inject the module object into a chunk (AMD2)", function() {
require([module.webpackPolyfill ? "./x1" : "./fail"]); 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) { it("should inject the module object into a chunk (ensure)", function(done) {
require.ensure([], function(require) { require.ensure([], function(require) {
module.webpackPolyfill.should.be.eql(1); expect(module.webpackPolyfill).toBe(1);
done(); done();
}); });
}); });

View File

@ -1,5 +1,5 @@
import fn from './file'; import fn from './file';
it("should compile correctly", function() { it("should compile correctly", function() {
fn().should.be.eql(1); expect(fn()).toBe(1);
}); });

View File

@ -1,4 +1,4 @@
it("should not fail on default export before export", function() { it("should not fail on default export before export", function() {
require("./file").default.should.be.eql("default"); expect(require("./file").default).toBe("default");
require("./file").CONSTANT.should.be.eql("const"); expect(require("./file").CONSTANT).toBe("const");
}); });

View File

@ -1,5 +1,5 @@
it("should support multiple reexports", function() { it("should support multiple reexports", function() {
require("./x").should.be.eql({ expect(require("./x")).toEqual({
xa: "a", xa: "a",
xb: "b", xb: "b",
xc: "c", xc: "c",

View File

@ -7,8 +7,8 @@ it("should bind this context on require callback", function(done) {
runWithThis({ok: true}, function() { runWithThis({ok: true}, function() {
require([], function() { require([], function() {
try { try {
require("./file").should.be.eql("file"); expect(require("./file")).toBe("file");
this.should.be.eql({ok: true}); expect(this).toEqual({ok: true});
done(); done();
} catch(e) { done(e); } } catch(e) { done(e); }
}.bind(this)); }.bind(this));
@ -19,9 +19,9 @@ it("should bind this context on require callback (loaded)", function(done) {
runWithThis({ok: true}, function() { runWithThis({ok: true}, function() {
require(["./load.js"], function(load) { require(["./load.js"], function(load) {
try { try {
require("./file").should.be.eql("file"); expect(require("./file")).toBe("file");
load.should.be.eql("load"); expect(load).toBe("load");
this.should.be.eql({ok: true}); expect(this).toEqual({ok: true});
done(); done();
} catch(e) { done(e); } } catch(e) { done(e); }
}.bind(this)); }.bind(this));
@ -32,8 +32,8 @@ it("should bind this context on require callback (foo)", function(done) {
var foo = {ok: true}; var foo = {ok: true};
require([], function(load) { require([], function(load) {
try { try {
require("./file").should.be.eql("file"); expect(require("./file")).toBe("file");
this.should.be.eql({ok: true}); expect(this).toEqual({ok: true});
done(); done();
} catch(e) { done(e); } } catch(e) { done(e); }
}.bind(foo)); }.bind(foo));
@ -43,9 +43,9 @@ it("should bind this context on require callback (foo, loaded)", function(done)
var foo = {ok: true}; var foo = {ok: true};
require(["./load.js"], function(load) { require(["./load.js"], function(load) {
try { try {
require("./file").should.be.eql("file"); expect(require("./file")).toBe("file");
load.should.be.eql("load"); expect(load).toBe("load");
this.should.be.eql({ok: true}); expect(this).toEqual({ok: true});
done(); done();
} catch(e) { done(e); } } catch(e) { done(e); }
}.bind(foo)); }.bind(foo));
@ -55,8 +55,8 @@ it("should bind this context on require callback (foo)", function(done) {
runWithThis({ok: true}, function() { runWithThis({ok: true}, function() {
require([], function(load) { require([], function(load) {
try { try {
require("./file").should.be.eql("file"); expect(require("./file")).toBe("file");
this.should.be.eql({ok: {ok: true}}); expect(this).toEqual({ok: {ok: true}});
done(); done();
} catch(e) { done(e); } } catch(e) { done(e); }
}.bind({ok: this})); }.bind({ok: this}));
@ -67,8 +67,8 @@ it("should bind this context on require.ensure callback", function(done) {
runWithThis({ok: true}, function() { runWithThis({ok: true}, function() {
require.ensure([], function(require) { require.ensure([], function(require) {
try { try {
require("./file").should.be.eql("file"); expect(require("./file")).toBe("file");
this.should.be.eql({ok: true}); expect(this).toEqual({ok: true});
done(); done();
} catch(e) { done(e); } } catch(e) { done(e); }
}.bind(this)); }.bind(this));
@ -79,8 +79,8 @@ it("should bind this context on require.ensure callback (loaded)", function(done
runWithThis({ok: true}, function() { runWithThis({ok: true}, function() {
require.ensure(["./load.js"], function(require) { require.ensure(["./load.js"], function(require) {
try { try {
require("./file").should.be.eql("file"); expect(require("./file")).toBe("file");
this.should.be.eql({ok: true}); expect(this).toEqual({ok: true});
done(); done();
} catch(e) { done(e); } } catch(e) { done(e); }
}.bind(this)); }.bind(this));

View File

@ -1,5 +1,5 @@
import {x} from './a' // named imported cases an errors import {x} from './a' // named imported cases an errors
it("should be able to import a named export", function() { it("should be able to import a named export", function() {
x.should.be.eql(1); expect(x).toBe(1);
}); });

View File

@ -9,7 +9,7 @@ it("should import into object shorthand", function() {
b, b,
c c
}; };
o.should.be.eql({ expect(o).toEqual({
a: 123, a: 123,
aa: 123, aa: 123,
b: 456, b: 456,

View File

@ -3,7 +3,7 @@ import { B } from "./module";
import { c } from "./module"; import { c } from "./module";
it("should allow to export a class", function() { it("should allow to export a class", function() {
(typeof A).should.be.eql("function"); expect((typeof A)).toBe("function");
(typeof B).should.be.eql("function"); expect((typeof B)).toBe("function");
c.should.be.eql("c"); expect(c).toBe("c");
}) })

View File

@ -51,7 +51,7 @@ import { count } from "./module";
it("should run async functions", function() { it("should run async functions", function() {
var org = count; var org = count;
notExportedAsync(); notExportedAsync();
count.should.be.eql(org + 1); expect(count).toBe(org + 1);
exportedAsync(); exportedAsync();
count.should.be.eql(org + 2); expect(count).toBe(org + 2);
}); });

View File

@ -6,8 +6,8 @@ it("should generate valid code when calling a harmony import function with brack
var c = fn((3), (4)); var c = fn((3), (4));
var d = fn(5, (6)); var d = fn(5, (6));
a.should.be.eql([1]); expect(a).toEqual([1]);
b.should.be.eql([2]); expect(b).toEqual([2]);
c.should.be.eql([3, 4]); expect(c).toEqual([3, 4]);
d.should.be.eql([5, 6]); expect(d).toEqual([5, 6]);
}); });

View File

@ -1,9 +1,9 @@
import defaultValue, { value, value2, value3, value4 } from "./module"; import defaultValue, { value, value2, value3, value4 } from "./module";
it("should be possible to redefine Object in a module", function() { it("should be possible to redefine Object in a module", function() {
value.should.be.eql(123); expect(value).toBe(123);
value2.should.be.eql(123); expect(value2).toBe(123);
value3.should.be.eql(123); expect(value3).toBe(123);
value4.should.be.eql(123); expect(value4).toBe(123);
defaultValue.should.be.eql(123); expect(defaultValue).toBe(123);
}); });

View File

@ -9,8 +9,8 @@ var func2 = function(x = a, y = b) {
} }
it("should import into default parameters", function() { it("should import into default parameters", function() {
func().should.be.eql(["a", "b"]); expect(func()).toEqual(["a", "b"]);
func2().should.be.eql(["a", "b"]); expect(func2()).toEqual(["a", "b"]);
func(1).should.be.eql([1, "b"]); expect(func(1)).toEqual([1, "b"]);
func2(2).should.be.eql([2, "b"]); expect(func2(2)).toEqual([2, "b"]);
}); });

View File

@ -1,7 +1,7 @@
it("should require existing module with supplied error callback", function(done) { it("should require existing module with supplied error callback", function(done) {
require(['./file'], function(file){ require(['./file'], function(file){
try { try {
file.should.be.eql("file"); expect(file).toBe("file");
done(); done();
} catch(e) { done(e); } } catch(e) { done(e); }
}, function(error) { done(error); }); }, 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) { require(['./file', './missingModule'], function(file){}, function(error) {
try { try {
error.should.be.instanceOf(Error); error.should.be.instanceOf(Error);
error.message.should.be.eql('Cannot find module "./missingModule"'); expect(error.message).toBe('Cannot find module "./missingModule"');
done(); done();
} catch(e) { } catch(e) {
done(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) { require(['./' + module], function(file){}, function(error) {
try { try {
error.should.be.instanceOf(Error); error.should.be.instanceOf(Error);
error.message.should.be.eql("Cannot find module \"./missingModule\"."); expect(error.message).toBe("Cannot find module \"./missingModule\".");
done(); done();
} catch(e) { done(e); } } 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) { require(['./throwing'], function(){}, function(error) {
try { try {
error.should.be.instanceOf(Error); error.should.be.instanceOf(Error);
error.message.should.be.eql('message'); expect(error.message).toBe('message');
done(); done();
} catch(e) { done(e); } } catch(e) { done(e); }
}); });
@ -47,7 +47,7 @@ it("should not call error callback on exception thrown in require callback", fun
}, function(error) { }, function(error) {
try { try {
error.should.be.instanceOf(Error); error.should.be.instanceOf(Error);
error.message.should.be.eql('message'); expect(error.message).toBe('message');
done(); done();
} catch(e) { done(e); } } catch(e) { done(e); }
}); });

View File

@ -1,6 +1,6 @@
import { a, b } from "./a"; import { a, b } from "./a";
it("should export a const value without semicolon", function() { it("should export a const value without semicolon", function() {
a.should.be.eql({x: 1}); expect(a).toEqual({x: 1});
b.should.be.eql({x: 2}); expect(b).toEqual({x: 2});
}); });

View File

@ -2,11 +2,11 @@ it("should polyfill System", function() {
if (typeof System === "object" && typeof System.register === "function") { if (typeof System === "object" && typeof System.register === "function") {
require("fail"); require("fail");
} }
(typeof System).should.be.eql("object"); expect((typeof System)).toBe("object");
(typeof System.register).should.be.eql("undefined"); expect((typeof System.register)).toBe("undefined");
(typeof System.get).should.be.eql("undefined"); expect((typeof System.get)).toBe("undefined");
(typeof System.set).should.be.eql("undefined"); expect((typeof System.set)).toBe("undefined");
(typeof System.anyNewItem).should.be.eql("undefined"); expect((typeof System.anyNewItem)).toBe("undefined");
var x = System.anyNewItem; var x = System.anyNewItem;
(typeof x).should.be.eql("undefined"); expect((typeof x)).toBe("undefined");
}) })

View File

@ -2,12 +2,12 @@ import * as file from "./file";
import * as file2 from "./file2"; import * as file2 from "./file2";
it("should translate indexed access to harmony import correctly", function() { it("should translate indexed access to harmony import correctly", function() {
file["default"].should.be.eql("default"); expect(file["default"]).toBe("default");
file["abc"].should.be.eql("abc"); expect(file["abc"]).toBe("abc");
}); });
it("should translate dynamic indexed access to harmony import correctly", function() { it("should translate dynamic indexed access to harmony import correctly", function() {
var fault = "fault"; var fault = "fault";
file2["de" + fault].should.be.eql("default"); expect(file2["de" + fault]).toBe("default");
file2["abc"].should.be.eql("abc"); expect(file2["abc"]).toBe("abc");
}); });

View File

@ -2,37 +2,37 @@ import { test } from "./file";
it("should hide import by local var", function() { it("should hide import by local var", function() {
var test = "ok"; var test = "ok";
test.should.be.eql("ok"); expect(test).toBe("ok");
}); });
it("should hide import by object pattern", function() { it("should hide import by object pattern", function() {
var { test } = { test: "ok" }; var { test } = { test: "ok" };
test.should.be.eql("ok"); expect(test).toBe("ok");
}); });
it("should hide import by array pattern", function() { it("should hide import by array pattern", function() {
var [test] = ["ok"]; var [test] = ["ok"];
test.should.be.eql("ok"); expect(test).toBe("ok");
}); });
it("should hide import by array pattern (nested)", function() { it("should hide import by array pattern (nested)", function() {
var [[test]] = [["ok"]]; var [[test]] = [["ok"]];
test.should.be.eql("ok"); expect(test).toBe("ok");
}); });
it("should hide import by pattern in function", function() { it("should hide import by pattern in function", function() {
(function({test}) { (function({test}) {
test.should.be.eql("ok"); expect(test).toBe("ok");
}({ test: "ok" })); }({ test: "ok" }));
}); });
it("should allow import in default (incorrect)", function() { it("should allow import in default (incorrect)", function() {
var { other = test, test } = { test: "ok" }; var { other = test, test } = { test: "ok" };
test.should.be.eql("ok"); expect(test).toBe("ok");
(typeof other).should.be.eql("undefined"); expect((typeof other)).toBe("undefined");
}); });
it("should allow import in default", function() { it("should allow import in default", function() {
var { other = test } = { test: "ok" }; var { other = test } = { test: "ok" };
other.should.be.eql("test"); expect(other).toBe("test");
}); });

View File

@ -1,7 +1,7 @@
it("should parse multiple expressions in a require", function(done) { it("should parse multiple expressions in a require", function(done) {
var name = "abc"; var name = "abc";
require(["./" + name + "/" + name + "Test"], function(x) { require(["./" + name + "/" + name + "Test"], function(x) {
x.should.be.eql("ok"); expect(x).toBe("ok");
done(); done();
}); });
}); });

View File

@ -1,3 +1,3 @@
it("should generate valid code", function() { it("should generate valid code", function() {
require("./module").myTest.should.be.eql("test"); expect(require("./module").myTest).toBe("test");
}); });

View File

@ -10,7 +10,7 @@ it("should parse cujojs UMD modules", function() {
? define ? define
: function (factory) { module.exports = factory(require); } : 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() { 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 = 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() { 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 ? define
: function (factory) { module.exports = factory(require); } : function (factory) { module.exports = factory(require); }
)); ));
module.exports.should.be.eql(4321); expect(module.exports).toBe(4321);
}); });

View File

@ -8,7 +8,7 @@ it("should not find a free exports", function() {
if(typeof exports !== "undefined") if(typeof exports !== "undefined")
(x.default).should.be.equal(exports); (x.default).should.be.equal(exports);
else else
(x.default).should.be.eql(false); expect((x.default)).toBe(false);
}); });
export {} export {}

View File

@ -1,4 +1,4 @@
it("should be possible to export default an imported name", function() { it("should be possible to export default an imported name", function() {
var x = require("./module"); var x = require("./module");
x.should.be.eql({ default: 1234 }); expect(x).toEqual({ default: 1234 });
}); });

View File

@ -2,7 +2,7 @@ import def from "./module?harmony";
import * as mod from "./module?harmony-start" import * as mod from "./module?harmony-start"
it("should export a sequence expression correctly", function() { it("should export a sequence expression correctly", function() {
require("./module?cjs").should.be.eql({ default: 2 }); expect(require("./module?cjs")).toEqual({ default: 2 });
def.should.be.eql(2); expect(def).toBe(2);
mod.default.should.be.eql(2); expect(mod.default).toBe(2);
}); });

View File

@ -5,7 +5,7 @@ it("should parse dynamic property names", function() {
[require("./a")]: "a", [require("./a")]: "a",
[b]: "b" [b]: "b"
}; };
o.should.be.eql({ expect(o).toEqual({
a: "a", a: "a",
b: "b" b: "b"
}); });
@ -21,7 +21,7 @@ it("should match dynamic property names", function() {
[b]: cc [b]: cc
} }
}]] = [0, 1, {b: {b: "c"}}]; }]] = [0, 1, {b: {b: "c"}}];
aa.should.be.eql("a"); expect(aa).toBe("a");
bb.should.be.eql("b"); expect(bb).toBe("b");
cc.should.be.eql("c"); expect(cc).toBe("c");
}); });

View File

@ -1,5 +1,5 @@
it("should find var declaration later in code", function() { it("should find var declaration later in code", function() {
(typeof require).should.be.eql("undefined"); expect((typeof require)).toBe("undefined");
var require; var require;
}); });
@ -10,7 +10,7 @@ it("should find var declaration in same statement", function() {
}), require; }), require;
require = (function(x) { require = (function(x) {
x.should.be.eql("fail"); expect(x).toBe("fail");
}); });
fn(); fn();
}); });
@ -18,7 +18,7 @@ it("should find var declaration in same statement", function() {
it("should find a catch block declaration", function() { it("should find a catch block declaration", function() {
try { try {
var f = (function(x) { var f = (function(x) {
x.should.be.eql("fail"); expect(x).toBe("fail");
}); });
throw f; throw f;
} catch(require) { } catch(require) {
@ -28,7 +28,7 @@ it("should find a catch block declaration", function() {
it("should find var declaration in control statements", function() { it("should find var declaration in control statements", function() {
var f = (function(x) { var f = (function(x) {
x.should.be.eql("fail"); expect(x).toBe("fail");
}); });
(function() { (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() { it("should find var declaration in control statements after usage", function() {
var f = (function(x) { var f = (function(x) {
x.should.be.eql("fail"); expect(x).toBe("fail");
}); });
(function() { (function() {

View File

@ -2,7 +2,7 @@
it("should find var declaration in control statements", function() { it("should find var declaration in control statements", function() {
var f = (function(x) { var f = (function(x) {
x.should.be.eql("fail"); expect(x).toBe("fail");
}); });
(function() { (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() { it("should find var declaration in control statements after usage", function() {
var f = (function(x) { var f = (function(x) {
x.should.be.eql("fail"); expect(x).toBe("fail");
}); });
(function() { (function() {

Some files were not shown because too many files have changed in this diff Show More