Skip to content

Commit 7a70020

Browse files
committed
wip
1 parent 998f768 commit 7a70020

File tree

15 files changed

+50
-52
lines changed

15 files changed

+50
-52
lines changed

test/watchCases/cache/child-compilation-cache/0/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ it("should use correct caches in compilation and child compilations", function()
22
var x = require("./report-cache-counters-loader!./changing-file");
33
switch(WATCH_STEP) {
44
case "0":
5-
x.should.be.eql([1, 1]);
5+
expect(x).toEqual([1, 1]);
66
break;
77
case "1":
8-
x.should.be.eql([2, 1]);
8+
expect(x).toEqual([2, 1]);
99
break;
1010
case "2":
11-
x.should.be.eql([3, 2]);
11+
expect(x).toEqual([3, 2]);
1212
break;
1313
default:
1414
throw new Error("Not handled step");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
it("should detect changes in a context", function() {
22
var context = require.context("./directory");
3-
context.keys().length.should.be.eql((+WATCH_STEP) % 3 * 2);
3+
expect(context.keys().length).toBe((+WATCH_STEP) % 3 * 2);
44
});

test/watchCases/parsing/caching-harmony/0/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import m from "./module";
22
import cm from "./changing-module";
33

44
it("should flag harmony modules correctly", function() {
5-
m.should.be.eql("module" + WATCH_STEP);
5+
expect(m).toBe("module" + WATCH_STEP);
66
switch(WATCH_STEP) {
77
case "0":
8-
cm.should.be.eql("original");
8+
expect(cm).toBe("original");
99
break;
1010
case "1":
11-
cm.should.be.eql("change");
11+
expect(cm).toBe("change");
1212
break;
1313
}
1414
});

test/watchCases/parsing/switching-harmony/0/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ import ch from "./ch";
44
import cc from "./cc";
55

66
it("should flag modules correctly", function() {
7-
hh.should.be.eql("hh" + WATCH_STEP);
8-
cc.should.be.eql("cc" + WATCH_STEP);
9-
hc.should.be.eql("hc" + WATCH_STEP);
10-
ch.should.be.eql("ch" + WATCH_STEP);
11-
require("./hh").default.should.be.eql("hh" + WATCH_STEP);
12-
require("./cc").should.be.eql("cc" + WATCH_STEP);
7+
expect(hh).toBe("hh" + WATCH_STEP);
8+
expect(cc).toBe("cc" + WATCH_STEP);
9+
expect(hc).toBe("hc" + WATCH_STEP);
10+
expect(ch).toBe("ch" + WATCH_STEP);
11+
expect(require("./hh").default).toBe("hh" + WATCH_STEP);
12+
expect(require("./cc")).toBe("cc" + WATCH_STEP);
1313
switch(WATCH_STEP) {
1414
case "0":
15-
require("./hc").default.should.be.eql("hc0");
16-
require("./ch").should.be.eql("ch0");
15+
expect(require("./hc").default).toBe("hc0");
16+
expect(require("./ch")).toBe("ch0");
1717
break;
1818
case "1":
19-
require("./hc").should.be.eql("hc1");
20-
require("./ch").default.should.be.eql("ch1");
19+
expect(require("./hc")).toBe("hc1");
20+
expect(require("./ch").default).toBe("ch1");
2121
break;
2222
}
2323
});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
it("should watch for changes", function() {
2-
require("./foo/" + WATCH_STEP).should.be.eql('This is only a test.' + WATCH_STEP);
2+
expect(require("./foo/" + WATCH_STEP)).toBe('This is only a test.' + WATCH_STEP);
33
if(+WATCH_STEP > 0) {
44
for(var m of STATS_JSON.modules.filter(m => /(a|b|c)\.js$/.test(m.identifier)))
5-
m.prefetched.should.be.true();
5+
expect(m.prefetched).toBe(true);
66
}
77
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import value from "dll/module";
22

33
it("should have the correct default export", function() {
4-
value.should.be.eql("ok");
4+
expect(value).toBe("ok");
55
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import value from "dll/module";
22

33
it("should have still the correct default export", function() {
4-
value.should.be.eql("ok");
4+
expect(value).toBe("ok");
55
});
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
it("should watch for changes", function() {
22
if(WATCH_STEP === '0') {
3-
require("./foo/" + WATCH_STEP).should.be.eql('This is only a test.' + WATCH_STEP);
3+
expect(require("./foo/" + WATCH_STEP)).toBe('This is only a test.' + WATCH_STEP);
44
}
55
else if(WATCH_STEP === '1') {
6-
require("./foo/" + WATCH_STEP).should.be.eql('This should be a test.' + WATCH_STEP);
6+
expect(require("./foo/" + WATCH_STEP)).toBe('This should be a test.' + WATCH_STEP);
77
}
88
else if(WATCH_STEP === '2') {
9-
require("./foo/" + WATCH_STEP).should.be.eql('This should be working.' + WATCH_STEP);
9+
expect(require("./foo/" + WATCH_STEP)).toBe('This should be working.' + WATCH_STEP);
1010
}
1111

12-
STATS_JSON.modules.length.should.equal(4 + Number(WATCH_STEP));
12+
expect(STATS_JSON.modules.length).toBe(4 + Number(WATCH_STEP));
1313
});

test/watchCases/plugins/watch-ignore-plugin/0/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import value from "./file"
22
import a from "./a"
33
const req = require.context("./foo", false, /^.*\.js$/);
44
it("should ignore change to file and directory", function() {
5-
a.should.be.eql(+WATCH_STEP);
6-
req.keys().should.be.deepEqual(["./0.js"])
7-
value.should.be.eql(1);
5+
expect(a).toBe(+WATCH_STEP);
6+
expect(req.keys()).toEqual(["./0.js"])
7+
expect(value).toBe(1);
88
});
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
it("should recover from missing module", function() {
22
switch(WATCH_STEP) {
33
case "0":
4-
(function() {
4+
expect(function() {
55
require("some-module");
6-
}).should.throw();
6+
}).toThrow();
77
break;
88
case "1":
9-
require("some-module").should.be.eql("ok");
9+
expect(require("some-module")).toBe("ok");
1010
break;
1111
}
1212
});

test/watchCases/runtime/dynamic-import/0/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
it("should change chunkhash of main chunk", function () {
22
const mainChunk = STATS_JSON.chunks.find((chunk) => chunk.names.indexOf("main") !== -1);
3-
(!mainChunk).should.be.false("Main chunk not found");
3+
expect(mainChunk).toBeDefined();
44
switch (WATCH_STEP) {
55
case "0":
66
STATE.hash = mainChunk.hash;
77
break;
88
case "1":
9-
mainChunk.hash.should.be.not.eql(STATE.hash);
9+
expect(mainChunk.hash).not.toBe(STATE.hash);
1010
break;
1111
}
1212
});
@@ -17,10 +17,10 @@ it("should load additional chunk", function() {
1717
.then((dynamic) => {
1818
switch (step) {
1919
case "0":
20-
dynamic.default.should.be.eql("Normal");
20+
expect(dynamic.default).toBe("Normal");
2121
break;
2222
case "1":
23-
dynamic.default.should.be.eql("Changed");
23+
expect(dynamic.default).toBe("Changed");
2424
break;
2525
}
2626
});

test/watchCases/runtime/static-import/0/index.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
require("should");
2-
31
import * as both from './dynamic-and-static'
42
import * as staticModule from './static'
53

64
it("should not change chunkhash of manifest chunk", function () {
75
const manifestChunk = STATS_JSON.chunks.find((chunk) => chunk.names.indexOf("main-runtime") !== -1);
8-
(!manifestChunk).should.be.false("Main chunk not found");
6+
expect(manifestChunk).toBeDefined();
97
switch (WATCH_STEP) {
108
case "0":
119
STATE.hash = manifestChunk.hash;
12-
staticModule.should.be.eql("Normal");
13-
both.should.be.eql("Normal");
10+
expect(staticModule).toBe("Normal");
11+
expect(both).toBe("Normal");
1412
break;
1513
case "1":
16-
manifestChunk.hash.should.be.eql(STATE.hash);
17-
staticModule.should.be.eql("Changed");
18-
both.should.be.eql("Normal");
14+
expect(manifestChunk.hash).toBe(STATE.hash);
15+
expect(staticModule).toBe("Changed");
16+
expect(both).toBe("Normal");
1917
break;
2018
case "2":
21-
manifestChunk.hash.should.be.eql(STATE.hash);
22-
staticModule.should.be.eql("Changed");
23-
both.should.be.eql("Changed");
19+
expect(manifestChunk.hash).toBe(STATE.hash);
20+
expect(staticModule).toBe("Changed");
21+
expect(both).toBe("Changed");
2422
break;
2523
}
2624
});
@@ -32,10 +30,10 @@ it("should load additional chunk", function() {
3230
switch (step) {
3331
case "0":
3432
case "1":
35-
dynamic.default.should.be.eql("Normal");
33+
expect(dynamic.default).toBe("Normal");
3634
break;
3735
case "2":
38-
dynamic.default.should.be.eql("Changed");
36+
expect(dynamic.default).toBe("Changed");
3937
break;
4038
}
4139
});

test/watchCases/simple/multi-compiler/0/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ require("./changing-file")
22
it("should watch for changes", function() {
33
switch(WATCH_STEP) {
44
case "0":
5-
STATS_JSON.children.should.have.size(2);
5+
expect(STATS_JSON.children).toHaveLength(2);
66
break;
77
case "1":
8-
STATS_JSON.children.should.have.size(1);
8+
expect(STATS_JSON.children).toHaveLength(1);
99
break;
1010
}
1111
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
it("should watch for changes", function() {
2-
require("./changing-file").should.be.eql(WATCH_STEP);
2+
expect(require("./changing-file")).toBe(WATCH_STEP);
33
})

test/watchCases/warnings/warnings-contribute-to-hash/0/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ it("should detect a change on warnings change", function() {
66
STATE.hash = STATS_JSON.hash;
77
break;
88
case "1":
9-
STATS_JSON.hash.should.be.not.eql(STATE.hash);
9+
expect(STATS_JSON.hash).not.toBe(STATE.hash);
1010
break;
1111
}
1212
});

0 commit comments

Comments
 (0)