Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 7f12977

Browse files
authored
Remove usage of deprecated APIs in tests (#1521)
1 parent d654504 commit 7f12977

File tree

17 files changed

+103
-103
lines changed

17 files changed

+103
-103
lines changed

test/apps/basics/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,11 @@ describe('basics', function() {
324324
await r.load('/dirs/bar/xyz');
325325
await r.sapper.start();
326326

327-
assert.equal(await r.text('h1'), 'A page');
327+
assert.strictEqual(await r.text('h1'), 'A page');
328328

329329
await r.page.click('[href="dirs/foo/xyz"]');
330330
await r.wait();
331-
assert.equal(await r.text('h1'), 'B page');
331+
assert.strictEqual(await r.text('h1'), 'B page');
332332
});
333333

334334
it('find regexp routes', async () => {

test/apps/credentials/test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('credentials', function() {
2222
it('sends cookies when using this.fetch with credentials: "include"', async () => {
2323
await r.load('/credentials?creds=include&type=cookie');
2424

25-
assert.equal(
25+
assert.strictEqual(
2626
await r.text('h1'),
2727
'a: 1, b: 2, max-age: undefined'
2828
);
@@ -31,7 +31,7 @@ describe('credentials', function() {
3131
it('does not send cookies when using this.fetch with credentials: "omit"', async () => {
3232
await r.load('/credentials?creds=omit&type=cookie');
3333

34-
assert.equal(
34+
assert.strictEqual(
3535
await r.text('h1'),
3636
'unauthorized'
3737
);
@@ -40,7 +40,7 @@ describe('credentials', function() {
4040
it('sends cookies to same origin when using this.fetch without credentials', async () => {
4141
await r.load('/credentials?type=cookie');
4242

43-
assert.equal(
43+
assert.strictEqual(
4444
await r.text('h1'),
4545
'a: 1, b: 2, max-age: undefined'
4646
);
@@ -52,7 +52,7 @@ describe('credentials', function() {
5252
it('sends authorization when using this.fetch with credentials: "include"', async () => {
5353
await r.load('/credentials?creds=include&type=authorization');
5454

55-
assert.equal(
55+
assert.strictEqual(
5656
await r.text('h1'),
5757
'my-auth'
5858
);
@@ -61,7 +61,7 @@ describe('credentials', function() {
6161
it('does not send authorization when using this.fetch with credentials: "omit"', async () => {
6262
await r.load('/credentials?creds=omit&type=authorization');
6363

64-
assert.equal(
64+
assert.strictEqual(
6565
await r.text('h1'),
6666
'unauthorized'
6767
);
@@ -70,7 +70,7 @@ describe('credentials', function() {
7070
it('sends authorization to same origin when using this.fetch without credentials', async () => {
7171
await r.load('/credentials?type=authorization');
7272

73-
assert.equal(
73+
assert.strictEqual(
7474
await r.text('h1'),
7575
'my-auth'
7676
);
@@ -86,13 +86,13 @@ describe('credentials', function() {
8686
await r.page.click('#cookie');
8787
await r.wait();
8888

89-
assert.equal(
89+
assert.strictEqual(
9090
await r.text('h1'),
9191
'a: 1, b: 2, max-age: undefined'
9292
);
9393
});
9494

9595
it('survives the tests with no server errors', () => {
96-
assert.deepEqual(r.errors, []);
96+
assert.deepStrictEqual(r.errors, []);
9797
});
9898
});

test/apps/css/test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('css', function() {
1919
it('includes critical CSS with server render', async () => {
2020
await r.load('/');
2121

22-
assert.equal(
22+
assert.strictEqual(
2323
await r.page.$eval('h1', node => getComputedStyle(node).color),
2424
'rgb(255, 0, 0)'
2525
);
@@ -28,7 +28,7 @@ describe('css', function() {
2828
it('includes CSS on error page', async () => {
2929
await r.load('/doesnotexist');
3030

31-
assert.equal(
31+
assert.strictEqual(
3232
await r.page.$eval('h1', node => getComputedStyle(node).color),
3333
'rgb(128, 0, 128)'
3434
);
@@ -37,7 +37,7 @@ describe('css', function() {
3737
// note that we're specifically testing another route here and not just a component
3838
it('includes CSS from imported route', async () => {
3939
await r.load('/index2');
40-
assert.equal(
40+
assert.strictEqual(
4141
await r.page.$eval('h1', node => getComputedStyle(node).color),
4242
'rgb(255, 0, 0)'
4343
);
@@ -52,7 +52,7 @@ describe('css', function() {
5252
await r.page.click(`[href="foo"]`);
5353
await r.wait();
5454

55-
assert.equal(
55+
assert.strictEqual(
5656
await r.page.$eval('h1', node => getComputedStyle(node).color),
5757
'rgb(0, 0, 255)'
5858
);
@@ -67,13 +67,13 @@ describe('css', function() {
6767
await r.page.click(`[href="bar"]`);
6868
await r.wait();
6969

70-
assert.equal(
70+
assert.strictEqual(
7171
await r.page.$eval('h1', node => getComputedStyle(node).color),
7272
'rgb(0, 128, 0)'
7373
);
7474
});
7575

7676
it('survives the tests with no server errors', () => {
77-
assert.deepEqual(r.errors, []);
77+
assert.deepStrictEqual(r.errors, []);
7878
});
7979
});

test/apps/custom-extension/test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('custom extensions', function() {
2121
await r.load(`/`);
2222

2323

24-
assert.equal(
24+
assert.strictEqual(
2525
await r.text('h1'),
2626
'Great success!'
2727
);
@@ -30,28 +30,28 @@ describe('custom extensions', function() {
3030
it('works with other arbitrary extensions', async () => {
3131
await r.load(`/const`);
3232

33-
assert.equal(
33+
assert.strictEqual(
3434
await r.text('h1'),
3535
'Tremendous!'
3636
);
3737

3838
await r.load(`/a`);
3939

40-
assert.equal(
40+
assert.strictEqual(
4141
await r.text('h1'),
4242
'a'
4343
);
4444

4545
await r.load(`/test-slug`);
4646

47-
assert.equal(
47+
assert.strictEqual(
4848
await r.text('h1'),
4949
'TEST-SLUG'
5050
);
5151

5252
await r.load(`/unsafe-replacement`);
5353

54-
assert.equal(
54+
assert.strictEqual(
5555
await r.text('h1'),
5656
'Bazooom!'
5757
);

test/apps/encoding/test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('encoding', function() {
1919
it('encodes routes', async () => {
2020
await r.load('/fünke');
2121

22-
assert.equal(
22+
assert.strictEqual(
2323
await r.text('h1'),
2424
`I'm afraid I just blue myself`
2525
);
@@ -28,7 +28,7 @@ describe('encoding', function() {
2828
it('encodes req.params and req.query for server-rendered pages', async () => {
2929
await r.load('/echo/page/encöded?message=hëllö+wörld&föo=bar&=baz&tel=%2B123456789');
3030

31-
assert.equal(
31+
assert.strictEqual(
3232
await r.text('h1'),
3333
'encöded {"message":"hëllö wörld","föo":"bar","":"baz","tel":"+123456789"}'
3434
);
@@ -42,7 +42,7 @@ describe('encoding', function() {
4242
await r.page.click('a');
4343
await r.wait();
4444

45-
assert.equal(
45+
assert.strictEqual(
4646
await r.text('h1'),
4747
'encöded {"message":"hëllö wörld","föo":"bar","":"baz","tel":"+123456789"}'
4848
);
@@ -51,13 +51,13 @@ describe('encoding', function() {
5151
it('encodes req.params for server routes', async () => {
5252
await r.load('/echo/server-route/encöded');
5353

54-
assert.equal(
54+
assert.strictEqual(
5555
await r.text('h1'),
5656
'encöded'
5757
);
5858
});
5959

6060
it('survives the tests with no server errors', () => {
61-
assert.deepEqual(r.errors, []);
61+
assert.deepStrictEqual(r.errors, []);
6262
});
6363
});

test/apps/errors/test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('errors', function() {
1919
it('handles missing route on server', async () => {
2020
await r.load('/nope');
2121

22-
assert.equal(
22+
assert.strictEqual(
2323
await r.text('h1'),
2424
'404'
2525
);
@@ -32,7 +32,7 @@ describe('errors', function() {
3232
await r.page.click('[href="nope"]');
3333
await r.wait();
3434

35-
assert.equal(
35+
assert.strictEqual(
3636
await r.text('h1'),
3737
'404'
3838
);
@@ -41,7 +41,7 @@ describe('errors', function() {
4141
it('handles explicit 4xx on server', async () => {
4242
await r.load('/blog/nope');
4343

44-
assert.equal(
44+
assert.strictEqual(
4545
await r.text('h1'),
4646
'404'
4747
);
@@ -55,7 +55,7 @@ describe('errors', function() {
5555
await r.page.click('[href="blog/nope"]');
5656
await r.wait();
5757

58-
assert.equal(
58+
assert.strictEqual(
5959
await r.text('h1'),
6060
'404'
6161
);
@@ -64,7 +64,7 @@ describe('errors', function() {
6464
it('handles error on server', async () => {
6565
await r.load('/throw');
6666

67-
assert.equal(
67+
assert.strictEqual(
6868
await r.text('h1'),
6969
'500'
7070
);
@@ -87,7 +87,7 @@ describe('errors', function() {
8787
await r.page.click('[href="throw"]');
8888
await r.wait();
8989

90-
assert.equal(
90+
assert.strictEqual(
9191
await r.text('h1'),
9292
'500'
9393
);
@@ -97,7 +97,7 @@ describe('errors', function() {
9797
await r.load('/preload-reject');
9898
await r.sapper.start();
9999

100-
assert.equal(
100+
assert.strictEqual(
101101
await r.text('h1'),
102102
'500'
103103
);
@@ -106,7 +106,7 @@ describe('errors', function() {
106106
it('does not serve error page for explicit non-page errors', async () => {
107107
await r.load('/nope.json');
108108

109-
assert.equal(
109+
assert.strictEqual(
110110
await r.text('body'),
111111
'nope'
112112
);
@@ -115,7 +115,7 @@ describe('errors', function() {
115115
it('does not serve error page for thrown non-page errors', async () => {
116116
await r.load('/throw.json');
117117

118-
assert.equal(
118+
assert.strictEqual(
119119
await r.text('body'),
120120
'oops'
121121
);
@@ -125,7 +125,7 @@ describe('errors', function() {
125125
await r.load('/some-throw-page');
126126
await r.sapper.start();
127127

128-
assert.equal(
128+
assert.strictEqual(
129129
await r.text('h2'),
130130
'success'
131131
);
@@ -134,7 +134,7 @@ describe('errors', function() {
134134
it('does not serve error page for async non-page error', async () => {
135135
await r.load('/async-throw.json');
136136

137-
assert.equal(
137+
assert.strictEqual(
138138
await r.text('body'),
139139
'oops'
140140
);
@@ -147,14 +147,14 @@ describe('errors', function() {
147147

148148
await r.page.click('[href="enhance-your-calm"]');
149149
await r.wait();
150-
assert.equal(await r.text('h1'), '420');
150+
assert.strictEqual(await r.text('h1'), '420');
151151

152152
await r.page.goBack();
153153
await r.wait();
154-
assert.equal(await r.text('h1'), 'No error here');
154+
assert.strictEqual(await r.text('h1'), 'No error here');
155155
});
156156

157157
it('survives the tests with no server errors', () => {
158-
assert.deepEqual(r.errors, []);
158+
assert.deepStrictEqual(r.errors, []);
159159
});
160160
});

test/apps/export-without-serviceworker/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('export w/o serviceworker', function() {
1919

2020
assert.ok(client_assets.length > 0);
2121

22-
assert.deepEqual(non_client_assets.sort(), [
22+
assert.deepStrictEqual(non_client_assets.sort(), [
2323
'global.css',
2424
'index.html',
2525
].sort());

test/apps/export/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('export', function() {
2828
}
2929
}
3030

31-
assert.deepEqual(non_client_assets.sort(), [
31+
assert.deepStrictEqual(non_client_assets.sort(), [
3232
'blog.json',
3333
'blog/bar.json',
3434
'blog/bar/index.html',

test/apps/ignore/test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('ignore', function() {
1919
it('respects `options.ignore` values (RegExp)', async () => {
2020
await r.load('/foobar');
2121

22-
assert.equal(
22+
assert.strictEqual(
2323
await r.text('body'),
2424
'foobar'
2525
);
@@ -28,7 +28,7 @@ describe('ignore', function() {
2828
it('respects `options.ignore` values (String #1)', async () => {
2929
await r.load('/buzz');
3030

31-
assert.equal(
31+
assert.strictEqual(
3232
await r.text('body'),
3333
'buzz'
3434
);
@@ -37,7 +37,7 @@ describe('ignore', function() {
3737
it('respects `options.ignore` values (String #2)', async () => {
3838
await r.load('/fizzer');
3939

40-
assert.equal(
40+
assert.strictEqual(
4141
await r.text('body'),
4242
'fizzer'
4343
);
@@ -46,13 +46,13 @@ describe('ignore', function() {
4646
it('respects `options.ignore` values (Function)', async () => {
4747
await r.load('/hello');
4848

49-
assert.equal(
49+
assert.strictEqual(
5050
await r.text('body'),
5151
'hello'
5252
);
5353
});
5454

5555
it('survives the tests with no server errors', () => {
56-
assert.deepEqual(r.errors, []);
56+
assert.deepStrictEqual(r.errors, []);
5757
});
5858
});

0 commit comments

Comments
 (0)