Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/apps/basics/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,11 @@ describe('basics', function() {
await r.load('/dirs/bar/xyz');
await r.sapper.start();

assert.equal(await r.text('h1'), 'A page');
assert.strictEqual(await r.text('h1'), 'A page');

await r.page.click('[href="dirs/foo/xyz"]');
await r.wait();
assert.equal(await r.text('h1'), 'B page');
assert.strictEqual(await r.text('h1'), 'B page');
});

it('find regexp routes', async () => {
Expand Down
16 changes: 8 additions & 8 deletions test/apps/credentials/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('credentials', function() {
it('sends cookies when using this.fetch with credentials: "include"', async () => {
await r.load('/credentials?creds=include&type=cookie');

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

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

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

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

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

assert.equal(
assert.strictEqual(
await r.text('h1'),
'my-auth'
);
Expand All @@ -86,13 +86,13 @@ describe('credentials', function() {
await r.page.click('#cookie');
await r.wait();

assert.equal(
assert.strictEqual(
await r.text('h1'),
'a: 1, b: 2, max-age: undefined'
);
});

it('survives the tests with no server errors', () => {
assert.deepEqual(r.errors, []);
assert.deepStrictEqual(r.errors, []);
});
});
12 changes: 6 additions & 6 deletions test/apps/css/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('css', function() {
it('includes critical CSS with server render', async () => {
await r.load('/');

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

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

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

assert.equal(
assert.strictEqual(
await r.page.$eval('h1', node => getComputedStyle(node).color),
'rgb(0, 128, 0)'
);
});

it('survives the tests with no server errors', () => {
assert.deepEqual(r.errors, []);
assert.deepStrictEqual(r.errors, []);
});
});
10 changes: 5 additions & 5 deletions test/apps/custom-extension/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('custom extensions', function() {
await r.load(`/`);


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

assert.equal(
assert.strictEqual(
await r.text('h1'),
'Tremendous!'
);

await r.load(`/a`);

assert.equal(
assert.strictEqual(
await r.text('h1'),
'a'
);

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

assert.equal(
assert.strictEqual(
await r.text('h1'),
'TEST-SLUG'
);

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

assert.equal(
assert.strictEqual(
await r.text('h1'),
'Bazooom!'
);
Expand Down
10 changes: 5 additions & 5 deletions test/apps/encoding/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('encoding', function() {
it('encodes routes', async () => {
await r.load('/fünke');

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

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

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

assert.equal(
assert.strictEqual(
await r.text('h1'),
'encöded'
);
});

it('survives the tests with no server errors', () => {
assert.deepEqual(r.errors, []);
assert.deepStrictEqual(r.errors, []);
});
});
28 changes: 14 additions & 14 deletions test/apps/errors/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('errors', function() {
it('handles missing route on server', async () => {
await r.load('/nope');

assert.equal(
assert.strictEqual(
await r.text('h1'),
'404'
);
Expand All @@ -32,7 +32,7 @@ describe('errors', function() {
await r.page.click('[href="nope"]');
await r.wait();

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

assert.equal(
assert.strictEqual(
await r.text('h1'),
'404'
);
Expand All @@ -55,7 +55,7 @@ describe('errors', function() {
await r.page.click('[href="blog/nope"]');
await r.wait();

assert.equal(
assert.strictEqual(
await r.text('h1'),
'404'
);
Expand All @@ -64,7 +64,7 @@ describe('errors', function() {
it('handles error on server', async () => {
await r.load('/throw');

assert.equal(
assert.strictEqual(
await r.text('h1'),
'500'
);
Expand All @@ -87,7 +87,7 @@ describe('errors', function() {
await r.page.click('[href="throw"]');
await r.wait();

assert.equal(
assert.strictEqual(
await r.text('h1'),
'500'
);
Expand All @@ -97,7 +97,7 @@ describe('errors', function() {
await r.load('/preload-reject');
await r.sapper.start();

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

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

assert.equal(
assert.strictEqual(
await r.text('body'),
'oops'
);
Expand All @@ -125,7 +125,7 @@ describe('errors', function() {
await r.load('/some-throw-page');
await r.sapper.start();

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

assert.equal(
assert.strictEqual(
await r.text('body'),
'oops'
);
Expand All @@ -147,14 +147,14 @@ describe('errors', function() {

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

await r.page.goBack();
await r.wait();
assert.equal(await r.text('h1'), 'No error here');
assert.strictEqual(await r.text('h1'), 'No error here');
});

it('survives the tests with no server errors', () => {
assert.deepEqual(r.errors, []);
assert.deepStrictEqual(r.errors, []);
});
});
2 changes: 1 addition & 1 deletion test/apps/export-without-serviceworker/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('export w/o serviceworker', function() {

assert.ok(client_assets.length > 0);

assert.deepEqual(non_client_assets.sort(), [
assert.deepStrictEqual(non_client_assets.sort(), [
'global.css',
'index.html',
].sort());
Expand Down
2 changes: 1 addition & 1 deletion test/apps/export/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('export', function() {
}
}

assert.deepEqual(non_client_assets.sort(), [
assert.deepStrictEqual(non_client_assets.sort(), [
'blog.json',
'blog/bar.json',
'blog/bar/index.html',
Expand Down
10 changes: 5 additions & 5 deletions test/apps/ignore/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('ignore', function() {
it('respects `options.ignore` values (RegExp)', async () => {
await r.load('/foobar');

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

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

assert.equal(
assert.strictEqual(
await r.text('body'),
'fizzer'
);
Expand All @@ -46,13 +46,13 @@ describe('ignore', function() {
it('respects `options.ignore` values (Function)', async () => {
await r.load('/hello');

assert.equal(
assert.strictEqual(
await r.text('body'),
'hello'
);
});

it('survives the tests with no server errors', () => {
assert.deepEqual(r.errors, []);
assert.deepStrictEqual(r.errors, []);
});
});
Loading