From 5ff288f61b51f9c5f0d8cc9ebd371a8d881c68fd Mon Sep 17 00:00:00 2001 From: ktym4a Date: Fri, 16 Feb 2024 18:41:16 +0700 Subject: [PATCH] chore: Change `strictEqual` to `equal` (#10140) --- .../test/pagesGlobToRssItems.test.js | 2 +- packages/astro-rss/test/rss.test.js | 18 ++++---- packages/astro/test/astro-basic.nodetest.js | 31 ++++++------- .../astro/test/astro-children.nodetest.js | 44 +++++++++---------- ...markdown-frontmatter-injection.nodetest.js | 2 +- .../test/astro-markdown-plugins.nodetest.js | 16 +++---- .../astro-markdown-remarkRehype.nodetest.js | 11 ++--- .../test/astro-markdown-shiki.nodetest.js | 32 +++++++------- .../astro/test/astro-markdown-url.nodetest.js | 12 ++--- .../astro/test/astro-markdown.nodetest.js | 36 +++++++-------- .../astro/test/custom-404-html.nodetest.js | 8 ++-- .../custom-404-implicit-rerouting.nodetest.js | 8 ++-- .../custom-404-injected-from-dep.nodetest.js | 2 +- .../test/custom-404-injected.nodetest.js | 8 ++-- packages/astro/test/custom-404-md.nodetest.js | 6 +-- .../astro/test/custom-404-static.nodetest.js | 8 ++-- packages/astro/test/markdown.nodetest.js | 28 ++++++------ packages/astro/test/ssr-markdown.nodetest.js | 2 +- packages/create-astro/test/context.test.js | 26 +++++------ .../node/test/well-known-locations.test.js | 2 +- .../react/test/parsed-react-children.test.js | 4 +- .../remark/test/remark-collect-images.test.js | 4 +- 22 files changed, 152 insertions(+), 158 deletions(-) diff --git a/packages/astro-rss/test/pagesGlobToRssItems.test.js b/packages/astro-rss/test/pagesGlobToRssItems.test.js index b590daa382cb..e3da7351b0fb 100644 --- a/packages/astro-rss/test/pagesGlobToRssItems.test.js +++ b/packages/astro-rss/test/pagesGlobToRssItems.test.js @@ -47,7 +47,7 @@ describe('pagesGlobToRssItems', () => { }, ]; - assert.deepStrictEqual( + assert.deepEqual( items.sort((a, b) => a.pubDate - b.pubDate), expected ); diff --git a/packages/astro-rss/test/rss.test.js b/packages/astro-rss/test/rss.test.js index 3ef617486cb3..02df32f4810c 100644 --- a/packages/astro-rss/test/rss.test.js +++ b/packages/astro-rss/test/rss.test.js @@ -36,9 +36,9 @@ function assertXmlDeepEqual(a, b) { const parsedA = parseXmlString(a); const parsedB = parseXmlString(b); - assert.strictEqual(parsedA.err, null); - assert.strictEqual(parsedB.err, null); - assert.deepStrictEqual(parsedA.result, parsedB.result); + assert.equal(parsedA.err, null); + assert.equal(parsedB.err, null); + assert.deepEqual(parsedA.result, parsedB.result); } describe('rss', () => { @@ -58,7 +58,7 @@ describe('rss', () => { assertXmlDeepEqual(str, validXmlResult); const contentType = response.headers.get('Content-Type'); - assert.strictEqual(contentType, 'application/xml'); + assert.equal(contentType, 'application/xml'); }); it('should be the same string as getRssString', async () => { @@ -73,7 +73,7 @@ describe('rss', () => { const str1 = await response.text(); const str2 = await getRssString(options); - assert.strictEqual(str1, str2); + assert.equal(str1, str2); }); }); @@ -223,8 +223,8 @@ describe('getRssString', () => { link: phpFeedItem.link, }); - assert.strictEqual(res.success, false); - assert.strictEqual(res.error.issues[0].path[0], 'pubDate'); + assert.equal(res.success, false); + assert.equal(res.error.issues[0].path[0], 'pubDate'); }); it('should be extendable', () => { @@ -236,7 +236,7 @@ describe('getRssString', () => { } catch (e) { error = e.message; } - assert.strictEqual(error, null); + assert.equal(error, null); }); it('should not fail when an enclosure has a length of 0', async () => { @@ -264,6 +264,6 @@ describe('getRssString', () => { error = e.message; } - assert.strictEqual(error, null); + assert.equal(error, null); }); }); diff --git a/packages/astro/test/astro-basic.nodetest.js b/packages/astro/test/astro-basic.nodetest.js index f363d7287549..869abe3de181 100644 --- a/packages/astro/test/astro-basic.nodetest.js +++ b/packages/astro/test/astro-basic.nodetest.js @@ -97,7 +97,7 @@ describe('Astro basic build', () => { const $ = cheerio.load(html); // will be 1 if element rendered correctly - assert.strictEqual($('#one').length, 1); + assert.equal($('#one').length, 1); }); it('supports special chars in filename', async () => { @@ -108,19 +108,19 @@ describe('Astro basic build', () => { it('renders the components top-down', async () => { const html = await fixture.readFile('/order/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('#rendered-order').text(), 'Rendered order: A, B'); + assert.equal($('#rendered-order').text(), 'Rendered order: A, B'); }); it('renders markdown in utf-8 by default', async () => { const html = await fixture.readFile('/chinese-encoding-md/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('h1').text(), '我的第一篇博客文章'); + assert.equal($('h1').text(), '我的第一篇博客文章'); }); it('renders MDX in utf-8 by default', async () => { const html = await fixture.readFile('/chinese-encoding-mdx/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('h1').text(), '我的第一篇博客文章'); + assert.equal($('h1').text(), '我的第一篇博客文章'); }); it('Supports void elements whose name is a string (#2062)', async () => { @@ -128,25 +128,22 @@ describe('Astro basic build', () => { const $ = cheerio.load(html); // - assert.strictEqual($('body > :nth-child(1)').prop('outerHTML'), ''); + assert.equal($('body > :nth-child(1)').prop('outerHTML'), ''); // - assert.strictEqual($('body > :nth-child(2)').prop('outerHTML'), ''); + assert.equal($('body > :nth-child(2)').prop('outerHTML'), ''); // - assert.strictEqual($('body > :nth-child(3)').prop('outerHTML'), ''); + assert.equal($('body > :nth-child(3)').prop('outerHTML'), ''); // - assert.strictEqual( + assert.equal( $('body > :nth-child(4)').prop('outerHTML'), '' ); // textarea - assert.strictEqual( - $('body > :nth-child(5)').prop('outerHTML'), - '' - ); + assert.equal($('body > :nth-child(5)').prop('outerHTML'), ''); }); it('Generates pages that end with .mjs', async () => { @@ -159,18 +156,18 @@ describe('Astro basic build', () => { it('allows file:// urls as module specifiers', async () => { const html = await fixture.readFile('/fileurl/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('h1').text(), 'WORKS'); + assert.equal($('h1').text(), 'WORKS'); }); describe('preview', () => { it('returns 200 for valid URLs', async () => { const result = await fixture.fetch('/'); - assert.strictEqual(result.status, 200); + assert.equal(result.status, 200); }); it('returns 404 for invalid URLs', async () => { const result = await fixture.fetch('/bad-url'); - assert.strictEqual(result.status, 404); + assert.equal(result.status, 404); }); }); }); @@ -193,7 +190,7 @@ describe('Astro basic development', () => { it('Renders markdown in utf-8 by default', async () => { const res = await fixture.fetch('/chinese-encoding-md'); - assert.strictEqual(res.status, 200); + assert.equal(res.status, 200); const html = await res.text(); const $ = cheerio.load(html); assert.equal($('h1').text(), '我的第一篇博客文章'); @@ -205,7 +202,7 @@ describe('Astro basic development', () => { it('Renders MDX in utf-8 by default', async () => { const res = await fixture.fetch('/chinese-encoding-mdx'); - assert.strictEqual(res.status, 200); + assert.equal(res.status, 200); const html = await res.text(); const $ = cheerio.load(html); assert.equal($('h1').text(), '我的第一篇博客文章'); diff --git a/packages/astro/test/astro-children.nodetest.js b/packages/astro/test/astro-children.nodetest.js index 884442804eea..1e2e00d2c701 100644 --- a/packages/astro/test/astro-children.nodetest.js +++ b/packages/astro/test/astro-children.nodetest.js @@ -17,15 +17,15 @@ describe('Component children', () => { // test 1: Can pass text to Preact components const $preact = $('#preact'); - assert.strictEqual($preact.text().trim(), 'Hello world'); + assert.equal($preact.text().trim(), 'Hello world'); // test 2: Can pass text to Vue components const $vue = $('#vue'); - assert.strictEqual($vue.text().trim(), 'Hello world'); + assert.equal($vue.text().trim(), 'Hello world'); // test 3: Can pass text to Svelte components const $svelte = $('#svelte'); - assert.strictEqual($svelte.text().trim(), 'Hello world'); + assert.equal($svelte.text().trim(), 'Hello world'); }); it('Passes markup children to framework components', async () => { @@ -34,15 +34,15 @@ describe('Component children', () => { // test 1: Can pass markup to Preact components const $preact = $('#preact h1'); - assert.strictEqual($preact.text().trim(), 'Hello world'); + assert.equal($preact.text().trim(), 'Hello world'); // test 2: Can pass markup to Vue components const $vue = $('#vue h1'); - assert.strictEqual($vue.text().trim(), 'Hello world'); + assert.equal($vue.text().trim(), 'Hello world'); // test 3: Can pass markup to Svelte components const $svelte = $('#svelte h1'); - assert.strictEqual($svelte.text().trim(), 'Hello world'); + assert.equal($svelte.text().trim(), 'Hello world'); }); it('Passes multiple children to framework components', async () => { @@ -51,21 +51,21 @@ describe('Component children', () => { // test 1: Can pass multiple children to Preact components const $preact = $('#preact'); - assert.strictEqual($preact.children().length, 2); - assert.strictEqual($preact.children(':first-child').text().trim(), 'Hello world'); - assert.strictEqual($preact.children(':last-child').text().trim(), 'Goodbye world'); + assert.equal($preact.children().length, 2); + assert.equal($preact.children(':first-child').text().trim(), 'Hello world'); + assert.equal($preact.children(':last-child').text().trim(), 'Goodbye world'); // test 2: Can pass multiple children to Vue components const $vue = $('#vue'); - assert.strictEqual($vue.children().length, 2); - assert.strictEqual($vue.children(':first-child').text().trim(), 'Hello world'); - assert.strictEqual($vue.children(':last-child').text().trim(), 'Goodbye world'); + assert.equal($vue.children().length, 2); + assert.equal($vue.children(':first-child').text().trim(), 'Hello world'); + assert.equal($vue.children(':last-child').text().trim(), 'Goodbye world'); // test 3: Can pass multiple children to Svelte components const $svelte = $('#svelte'); - assert.strictEqual($svelte.children().length, 2); - assert.strictEqual($svelte.children(':first-child').text().trim(), 'Hello world'); - assert.strictEqual($svelte.children(':last-child').text().trim(), 'Goodbye world'); + assert.equal($svelte.children().length, 2); + assert.equal($svelte.children(':first-child').text().trim(), 'Hello world'); + assert.equal($svelte.children(':last-child').text().trim(), 'Goodbye world'); }); it('Renders a template when children are not rendered for client components', async () => { @@ -73,26 +73,26 @@ describe('Component children', () => { const $ = cheerio.load(html); // test 1: If SSR only, no children are rendered. - assert.strictEqual($('#ssr-only').children().length, 0); + assert.equal($('#ssr-only').children().length, 0); // test 2: If client, and no children are rendered, a template is. - assert.strictEqual( + assert.equal( $('#client').parent().children().length, 2, 'rendered the client component and a template' ); - assert.strictEqual( + assert.equal( $('#client').parent().find('template[data-astro-template]').length, 1, 'Found 1 template' ); // test 3: If client, and children are rendered, no template is. - assert.strictEqual($('#client-render').parent().children().length, 1); - assert.strictEqual($('#client-render').parent().find('template').length, 0); + assert.equal($('#client-render').parent().children().length, 1); + assert.equal($('#client-render').parent().find('template').length, 0); // test 4: If client and no children are provided, no template is. - assert.strictEqual($('#client-no-children').parent().children().length, 1); - assert.strictEqual($('#client-no-children').parent().find('template').length, 0); + assert.equal($('#client-no-children').parent().children().length, 1); + assert.equal($('#client-no-children').parent().find('template').length, 0); }); }); diff --git a/packages/astro/test/astro-markdown-frontmatter-injection.nodetest.js b/packages/astro/test/astro-markdown-frontmatter-injection.nodetest.js index 80d987f0323a..b40b352b8d5c 100644 --- a/packages/astro/test/astro-markdown-frontmatter-injection.nodetest.js +++ b/packages/astro/test/astro-markdown-frontmatter-injection.nodetest.js @@ -28,7 +28,7 @@ describe('Astro Markdown - frontmatter injection', () => { ); assert.ok(readingTimes.length > 0); for (let readingTime of readingTimes) { - assert.notStrictEqual(readingTime, null); + assert.notEqual(readingTime, null); assert.match(readingTime.text, /^\d+ min read/); } }); diff --git a/packages/astro/test/astro-markdown-plugins.nodetest.js b/packages/astro/test/astro-markdown-plugins.nodetest.js index 7de4e3e93223..03863a1ed3ca 100644 --- a/packages/astro/test/astro-markdown-plugins.nodetest.js +++ b/packages/astro/test/astro-markdown-plugins.nodetest.js @@ -46,7 +46,7 @@ describe('Astro Markdown plugins', () => { const $ = cheerio.load(html); // test 1: Added a TOC - assert.strictEqual($('.toc').length, 1); + assert.equal($('.toc').length, 1); // test 2: Added .title to h1 assert.ok($('#hello-world').hasClass('title')); @@ -56,11 +56,11 @@ describe('Astro Markdown plugins', () => { it('Still applies default plugins when user plugins are provided', async () => { const gfmHtml = await fixture.readFile('/with-gfm/index.html'); const $1 = cheerio.load(gfmHtml); - assert.strictEqual($1('a[href="https://example.com"]').length, 1); + assert.equal($1('a[href="https://example.com"]').length, 1); const smartypantsHtml = await fixture.readFile('/with-smartypants/index.html'); const $2 = cheerio.load(smartypantsHtml); - assert.strictEqual($2('p').html(), '“Smartypants” is — awesome'); + assert.equal($2('p').html(), '“Smartypants” is — awesome'); testRemark(gfmHtml); testRehype(gfmHtml, '#github-flavored-markdown-test'); @@ -71,7 +71,7 @@ describe('Astro Markdown plugins', () => { const $ = cheerio.load(html); // test 1: GFM autolink applied correctly - assert.strictEqual($('a[href="https://example.com"]').length, 1); + assert.equal($('a[href="https://example.com"]').length, 1); testRemark(html); testRehype(html, '#github-flavored-markdown-test'); @@ -82,7 +82,7 @@ describe('Astro Markdown plugins', () => { const $ = cheerio.load(html); // test 1: smartypants applied correctly - assert.strictEqual($('p').html(), '“Smartypants” is — awesome'); + assert.equal($('p').html(), '“Smartypants” is — awesome'); testRemark(html); testRehype(html, '#smartypants-test'); @@ -99,7 +99,7 @@ describe('Astro Markdown plugins', () => { const html = await fixture.readFile('/with-gfm/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('a[href="https://example.com"]').length, 0); + assert.equal($('a[href="https://example.com"]').length, 0); testRemark(html); testRehype(html, '#github-flavored-markdown-test'); @@ -115,7 +115,7 @@ describe('Astro Markdown plugins', () => { const html = await fixture.readFile('/with-smartypants/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('p').html(), '"Smartypants" is -- awesome'); + assert.equal($('p').html(), '"Smartypants" is -- awesome'); testRemark(html); testRehype(html, '#smartypants-test'); @@ -124,7 +124,7 @@ describe('Astro Markdown plugins', () => { function testRehype(html, headingId) { const $ = cheerio.load(html); - assert.strictEqual($(headingId).length, 1); + assert.equal($(headingId).length, 1); assert.ok($(headingId).hasClass('title')); } diff --git a/packages/astro/test/astro-markdown-remarkRehype.nodetest.js b/packages/astro/test/astro-markdown-remarkRehype.nodetest.js index 18194d250fe1..40f9613e5373 100644 --- a/packages/astro/test/astro-markdown-remarkRehype.nodetest.js +++ b/packages/astro/test/astro-markdown-remarkRehype.nodetest.js @@ -15,11 +15,8 @@ describe('Astro Markdown without remark-rehype config', () => { it('Renders footnotes with default English labels', async () => { const html = await fixture.readFile('/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('#footnote-label').text(), 'Footnotes'); - assert.strictEqual( - $('.data-footnote-backref').first().attr('aria-label'), - 'Back to reference 1' - ); + assert.equal($('#footnote-label').text(), 'Footnotes'); + assert.equal($('.data-footnote-backref').first().attr('aria-label'), 'Back to reference 1'); }); }); @@ -41,7 +38,7 @@ describe('Astro Markdown with remark-rehype config', () => { it('Renders footnotes with values from the configuration', async () => { const html = await fixture.readFile('/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('#footnote-label').text(), 'Catatan kaki'); - assert.strictEqual($('.data-footnote-backref').first().attr('aria-label'), 'Kembali ke konten'); + assert.equal($('#footnote-label').text(), 'Catatan kaki'); + assert.equal($('.data-footnote-backref').first().attr('aria-label'), 'Kembali ke konten'); }); }); diff --git a/packages/astro/test/astro-markdown-shiki.nodetest.js b/packages/astro/test/astro-markdown-shiki.nodetest.js index 6f9b9a65e3f9..411a7256ec15 100644 --- a/packages/astro/test/astro-markdown-shiki.nodetest.js +++ b/packages/astro/test/astro-markdown-shiki.nodetest.js @@ -17,11 +17,11 @@ describe('Astro Markdown Shiki', () => { const $ = cheerio.load(html); // There should be no HTML from Prism - assert.strictEqual($('.token').length, 0); + assert.equal($('.token').length, 0); - assert.strictEqual($('pre').length, 2); + assert.equal($('pre').length, 2); assert.ok($('pre').hasClass('astro-code')); - assert.strictEqual( + assert.equal( $('pre').attr().style, 'background-color:#24292e;color:#e1e4e8; overflow-x: auto;' ); @@ -49,9 +49,9 @@ describe('Astro Markdown Shiki', () => { const html = await fixture.readFile('/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('pre').length, 1); + assert.equal($('pre').length, 1); assert.ok($('pre').hasClass('astro-code')); - assert.strictEqual( + assert.equal( $('pre').attr().style, 'background-color:#fff;color:#24292e; overflow-x: auto;' ); @@ -70,9 +70,9 @@ describe('Astro Markdown Shiki', () => { const html = await fixture.readFile('/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('pre').length, 1); + assert.equal($('pre').length, 1); assert.ok($('pre').hasClass('astro-code')); - assert.strictEqual( + assert.equal( $('pre').attr().style, 'background-color:#FDFDFE;color:#4E5377; overflow-x: auto;' ); @@ -93,9 +93,9 @@ describe('Astro Markdown Shiki', () => { const $ = cheerio.load(html); const segments = $('.line').get(6).children; - assert.strictEqual(segments.length, 2); - assert.strictEqual(segments[0].attribs.style, 'color:#79B8FF'); - assert.strictEqual(segments[1].attribs.style, 'color:#E1E4E8'); + assert.equal(segments.length, 2); + assert.equal(segments[0].attribs.style, 'color:#79B8FF'); + assert.equal(segments[1].attribs.style, 'color:#E1E4E8'); const unknownLang = $('.astro-code').get(1); assert.ok(unknownLang.attribs.style.includes('background-color:#24292e;color:#e1e4e8;')); @@ -130,8 +130,8 @@ describe('Astro Markdown Shiki', () => { const html = await fixtures.ifTrue.readFile('/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('pre').length, 1); - assert.strictEqual($('pre').attr('style'), style); + assert.equal($('pre').length, 1); + assert.equal($('pre').attr('style'), style); }); it('Markdown file with wrap = false', async () => { @@ -139,8 +139,8 @@ describe('Astro Markdown Shiki', () => { const html = await fixtures.ifFalse.readFile('/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('pre').length, 1); - assert.strictEqual($('pre').attr('style'), style); + assert.equal($('pre').length, 1); + assert.equal($('pre').attr('style'), style); }); it('Markdown file with wrap = null', async () => { @@ -148,8 +148,8 @@ describe('Astro Markdown Shiki', () => { const html = await fixtures.ifNull.readFile('/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('pre').length, 1); - assert.strictEqual($('pre').attr('style'), style); + assert.equal($('pre').length, 1); + assert.equal($('pre').attr('style'), style); }); }); }); diff --git a/packages/astro/test/astro-markdown-url.nodetest.js b/packages/astro/test/astro-markdown-url.nodetest.js index 9ba48a52dda4..9add78299c3a 100644 --- a/packages/astro/test/astro-markdown-url.nodetest.js +++ b/packages/astro/test/astro-markdown-url.nodetest.js @@ -19,7 +19,7 @@ describe('Astro Markdown URL', () => { const html = await fixture.readFile('/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('#url').attr('href'), baseUrl + '/'); + assert.equal($('#url').attr('href'), baseUrl + '/'); }); it('trailingSlash: never', async () => { @@ -34,7 +34,7 @@ describe('Astro Markdown URL', () => { const html = await fixture.readFile('/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('#url').attr('href'), baseUrl); + assert.equal($('#url').attr('href'), baseUrl); }); it('trailingSlash: ignore', async () => { @@ -49,7 +49,7 @@ describe('Astro Markdown URL', () => { const html = await fixture.readFile('/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('#url').attr('href'), baseUrl); + assert.equal($('#url').attr('href'), baseUrl); }); }); @@ -67,7 +67,7 @@ describe('Astro Markdown URL', () => { const html = await fixture.readFile('/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('#url').attr('href'), baseUrl + '/'); + assert.equal($('#url').attr('href'), baseUrl + '/'); }); it('trailingSlash: never', async () => { @@ -81,7 +81,7 @@ describe('Astro Markdown URL', () => { const html = await fixture.readFile('/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('#url').attr('href'), baseUrl); + assert.equal($('#url').attr('href'), baseUrl); }); it('trailingSlash: ignore', async () => { @@ -95,7 +95,7 @@ describe('Astro Markdown URL', () => { const html = await fixture.readFile('/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('#url').attr('href'), baseUrl); + assert.equal($('#url').attr('href'), baseUrl); }); }); }); diff --git a/packages/astro/test/astro-markdown.nodetest.js b/packages/astro/test/astro-markdown.nodetest.js index 01209bafd714..958b1cb4f1f5 100644 --- a/packages/astro/test/astro-markdown.nodetest.js +++ b/packages/astro/test/astro-markdown.nodetest.js @@ -18,7 +18,7 @@ describe('Astro Markdown', () => { it('Exposes raw markdown content', async () => { const { raw } = JSON.parse(await fixture.readFile('/raw-content.json')); - assert.strictEqual( + assert.equal( fixLineEndings(raw).trim(), `# Basic page\n\nLets make sure raw and compiled content look right!` ); @@ -27,7 +27,7 @@ describe('Astro Markdown', () => { it('Exposes compiled HTML content', async () => { const { compiled } = JSON.parse(await fixture.readFile('/raw-content.json')); - assert.strictEqual( + assert.equal( fixLineEndings(compiled).trim(), `

Basic page

\n

Lets make sure raw and compiled content look right!

` ); @@ -38,7 +38,7 @@ describe('Astro Markdown', () => { const html = await fixture.readFile('/code-in-md/index.html'); const $ = cheerio.load(html); - assert.notStrictEqual($('pre.astro-code').length, 0); + assert.notEqual($('pre.astro-code').length, 0); }); it('handles Prism', async () => { @@ -53,7 +53,7 @@ describe('Astro Markdown', () => { const html = await prismFixture.readFile('/code-in-md/index.html'); const $ = cheerio.load(html); - assert.notStrictEqual($('pre.language-html').length, 0); + assert.notEqual($('pre.language-html').length, 0); }); }); @@ -64,8 +64,8 @@ describe('Astro Markdown', () => { const contentTitle = $('[data-content-title]'); const frontmatterTitle = $('[data-frontmatter-title]'); - assert.strictEqual(contentTitle.text(), 'With layout'); - assert.strictEqual(frontmatterTitle.text(), 'With layout'); + assert.equal(contentTitle.text(), 'With layout'); + assert.equal(frontmatterTitle.text(), 'With layout'); }); it('Passes headings to layout via "headings" prop', async () => { @@ -85,7 +85,7 @@ describe('Astro Markdown', () => { const compiledContent = $('[data-compiled-content]'); - assert.strictEqual( + assert.equal( fixLineEndings(compiledContent.text()).trim(), `

Section 1

\n

Section 2

` ); @@ -97,7 +97,7 @@ describe('Astro Markdown', () => { const rawContent = $('[data-raw-content]'); - assert.strictEqual(fixLineEndings(rawContent.text()).trim(), `## Section 1\n\n## Section 2`); + assert.equal(fixLineEndings(rawContent.text()).trim(), `## Section 1\n\n## Section 2`); }); it('Exposes getHeadings() on glob imports', async () => { @@ -118,14 +118,14 @@ describe('Astro Markdown', () => { const file = $('[data-file]')?.text(); const url = $('[data-url]')?.text(); - assert.strictEqual( + assert.equal( frontmatterFile?.endsWith('with-layout.md'), true, '"file" prop does not end with correct path or is undefined' ); - assert.strictEqual(frontmatterUrl, '/with-layout'); - assert.strictEqual(file, frontmatterFile); - assert.strictEqual(url, frontmatterUrl); + assert.equal(frontmatterUrl, '/with-layout'); + assert.equal(file, frontmatterFile); + assert.equal(url, frontmatterUrl); }); describe('Vite env vars (#3412)', () => { @@ -134,18 +134,18 @@ describe('Astro Markdown', () => { const $ = cheerio.load(html); // test 1: referencing an existing var name - assert.strictEqual($('code').eq(0).text(), 'import.meta.env.SITE'); - assert.strictEqual($('li').eq(0).text(), 'import.meta.env.SITE'); + assert.equal($('code').eq(0).text(), 'import.meta.env.SITE'); + assert.equal($('li').eq(0).text(), 'import.meta.env.SITE'); assert.ok($('code').eq(3).text().includes('site: import.meta.env.SITE')); // // test 2: referencing a non-existing var name - assert.strictEqual($('code').eq(1).text(), 'import.meta.env.TITLE'); - assert.strictEqual($('li').eq(1).text(), 'import.meta.env.TITLE'); + assert.equal($('code').eq(1).text(), 'import.meta.env.TITLE'); + assert.equal($('li').eq(1).text(), 'import.meta.env.TITLE'); assert.ok($('code').eq(3).text().includes('title: import.meta.env.TITLE')); // // test 3: referencing `import.meta.env` itself (without any var name) - assert.strictEqual($('code').eq(2).text(), 'import.meta.env'); - assert.strictEqual($('li').eq(2).text(), 'import.meta.env'); + assert.equal($('code').eq(2).text(), 'import.meta.env'); + assert.equal($('li').eq(2).text(), 'import.meta.env'); assert.ok($('code').eq(3).text().includes('// Use Vite env vars with import.meta.env')); }); it('Allows referencing import.meta.env in frontmatter', async () => { diff --git a/packages/astro/test/custom-404-html.nodetest.js b/packages/astro/test/custom-404-html.nodetest.js index 115c19cdc67b..80504f59d5de 100644 --- a/packages/astro/test/custom-404-html.nodetest.js +++ b/packages/astro/test/custom-404-html.nodetest.js @@ -29,18 +29,18 @@ describe('Custom 404.html', () => { const html = await fixture.fetch('/').then((res) => res.text()); $ = cheerio.load(html); - assert.strictEqual($('h1').text(), 'Home'); + assert.equal($('h1').text(), 'Home'); }); it('renders 404 for /a', async () => { const res = await fixture.fetch('/a'); - assert.strictEqual(res.status, 404); + assert.equal(res.status, 404); const html = await res.text(); $ = cheerio.load(html); - assert.strictEqual($('h1').text(), 'Page not found'); - assert.strictEqual($('p').text(), 'This 404 is a static HTML file.'); + assert.equal($('h1').text(), 'Page not found'); + assert.equal($('p').text(), 'This 404 is a static HTML file.'); }); }); }); diff --git a/packages/astro/test/custom-404-implicit-rerouting.nodetest.js b/packages/astro/test/custom-404-implicit-rerouting.nodetest.js index 2c369d4f698a..35b5afa3aea7 100644 --- a/packages/astro/test/custom-404-implicit-rerouting.nodetest.js +++ b/packages/astro/test/custom-404-implicit-rerouting.nodetest.js @@ -27,8 +27,8 @@ for (const caseNumber of [1, 2, 3, 4]) { async () => { const resPromise = fixture.fetch('/'); const result = await withTimeout(resPromise, 1000); - assert.notStrictEqual(result, timeout); - assert.strictEqual(result.status, 200); + assert.notEqual(result, timeout); + assert.equal(result.status, 200); } ); @@ -40,8 +40,8 @@ for (const caseNumber of [1, 2, 3, 4]) { async () => { const resPromise = fixture.fetch('/alvsibdlvjks'); const result = await withTimeout(resPromise, 1000); - assert.notStrictEqual(result, timeout); - assert.strictEqual(result.status, 404); + assert.notEqual(result, timeout); + assert.equal(result.status, 404); } ); diff --git a/packages/astro/test/custom-404-injected-from-dep.nodetest.js b/packages/astro/test/custom-404-injected-from-dep.nodetest.js index 49fe10a10c29..13764d5098f1 100644 --- a/packages/astro/test/custom-404-injected-from-dep.nodetest.js +++ b/packages/astro/test/custom-404-injected-from-dep.nodetest.js @@ -17,7 +17,7 @@ describe('Custom 404 with injectRoute from dependency', () => { it('Build succeeds', async () => { const html = await fixture.readFile('/404.html'); - assert.strictEqual(html.includes(''), true); + assert.equal(html.includes(''), true); }); }); }); diff --git a/packages/astro/test/custom-404-injected.nodetest.js b/packages/astro/test/custom-404-injected.nodetest.js index 6e0e3ca9fbf2..48319734a008 100644 --- a/packages/astro/test/custom-404-injected.nodetest.js +++ b/packages/astro/test/custom-404-injected.nodetest.js @@ -29,18 +29,18 @@ describe('Custom 404 with injectRoute', () => { const html = await fixture.fetch('/').then((res) => res.text()); $ = cheerio.load(html); - assert.strictEqual($('h1').text(), 'Home'); + assert.equal($('h1').text(), 'Home'); }); it('renders 404 for /a', async () => { const res = await fixture.fetch('/a'); - assert.strictEqual(res.status, 404); + assert.equal(res.status, 404); const html = await res.text(); $ = cheerio.load(html); - assert.strictEqual($('h1').text(), 'Page not found'); - assert.strictEqual($('p').text(), '/a'); + assert.equal($('h1').text(), 'Page not found'); + assert.equal($('p').text(), '/a'); }); }); }); diff --git a/packages/astro/test/custom-404-md.nodetest.js b/packages/astro/test/custom-404-md.nodetest.js index 0e668a720a40..68b5a5ebaa6b 100644 --- a/packages/astro/test/custom-404-md.nodetest.js +++ b/packages/astro/test/custom-404-md.nodetest.js @@ -28,17 +28,17 @@ describe('Custom 404 Markdown', () => { const html = await fixture.fetch('/').then((res) => res.text()); $ = cheerio.load(html); - assert.strictEqual($('h1').text(), 'Home'); + assert.equal($('h1').text(), 'Home'); }); it('renders 404 for /abc', async () => { const res = await fixture.fetch('/a'); - assert.strictEqual(res.status, 404); + assert.equal(res.status, 404); const html = await res.text(); $ = cheerio.load(html); - assert.strictEqual($('h1').text(), 'Page not found'); + assert.equal($('h1').text(), 'Page not found'); }); }); }); diff --git a/packages/astro/test/custom-404-static.nodetest.js b/packages/astro/test/custom-404-static.nodetest.js index 88c61658db11..5ab923dc4a2a 100644 --- a/packages/astro/test/custom-404-static.nodetest.js +++ b/packages/astro/test/custom-404-static.nodetest.js @@ -29,18 +29,18 @@ describe('Custom 404 with Static', () => { const html = await fixture.fetch('/').then((res) => res.text()); $ = cheerio.load(html); - assert.strictEqual($('h1').text(), 'Home'); + assert.equal($('h1').text(), 'Home'); }); it('renders 404 for /a', async () => { const res = await fixture.fetch('/a'); - assert.strictEqual(res.status, 404); + assert.equal(res.status, 404); const html = await res.text(); $ = cheerio.load(html); - assert.strictEqual($('h1').text(), 'Page not found'); - assert.strictEqual($('p').text(), '/a'); + assert.equal($('h1').text(), 'Page not found'); + assert.equal($('p').text(), '/a'); }); }); diff --git a/packages/astro/test/markdown.nodetest.js b/packages/astro/test/markdown.nodetest.js index ad8d2de0a636..1e78409ce8d3 100644 --- a/packages/astro/test/markdown.nodetest.js +++ b/packages/astro/test/markdown.nodetest.js @@ -21,52 +21,52 @@ describe('Markdown tests', () => { it('Can load a markdown page with the `.markdown` extension', async () => { const html = await fixture.readFile('/dot-markdown-page/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('h1').html(), 'Page with alternative .markdown extension'); - assert.strictEqual($('p').html(), 'Hope this loads fine 🤞'); + assert.equal($('h1').html(), 'Page with alternative .markdown extension'); + assert.equal($('p').html(), 'Hope this loads fine 🤞'); }); it('Can load a markdown page with the `.mdwn` extension', async () => { const html = await fixture.readFile('/dot-mdwn-page/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('h1').html(), 'Page with alternative .mdwn extension'); - assert.strictEqual($('p').html(), 'Hope this loads fine 🤞'); + assert.equal($('h1').html(), 'Page with alternative .mdwn extension'); + assert.equal($('p').html(), 'Hope this loads fine 🤞'); }); it('Can load a markdown page with the `.mkdn` extension', async () => { const html = await fixture.readFile('/dot-mkdn-page/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('h1').html(), 'Page with alternative .mkdn extension'); - assert.strictEqual($('p').html(), 'Hope this loads fine 🤞'); + assert.equal($('h1').html(), 'Page with alternative .mkdn extension'); + assert.equal($('p').html(), 'Hope this loads fine 🤞'); }); it('Can load a markdown page with the `.mdown` extension', async () => { const html = await fixture.readFile('/dot-mdown-page/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('h1').html(), 'Page with alternative .mdown extension'); - assert.strictEqual($('p').html(), 'Hope this loads fine 🤞'); + assert.equal($('h1').html(), 'Page with alternative .mdown extension'); + assert.equal($('p').html(), 'Hope this loads fine 🤞'); }); it('Can load a markdown page with the `.mkd` extension', async () => { const html = await fixture.readFile('/dot-mkd-page/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('h1').html(), 'Page with alternative .mkd extension'); - assert.strictEqual($('p').html(), 'Hope this loads fine 🤞'); + assert.equal($('h1').html(), 'Page with alternative .mkd extension'); + assert.equal($('p').html(), 'Hope this loads fine 🤞'); }); it('Can load a simple markdown page with Astro', async () => { const html = await fixture.readFile('/post/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('p').first().text(), 'Hello world!'); - assert.strictEqual($('#first').text(), 'Some content'); - assert.strictEqual($('#interesting-topic').text(), 'Interesting Topic'); + assert.equal($('p').first().text(), 'Hello world!'); + assert.equal($('#first').text(), 'Some content'); + assert.equal($('#interesting-topic').text(), 'Interesting Topic'); }); it('Can load a realworld markdown page with Astro', async () => { const html = await fixture.readFile('/realworld/index.html'); const $ = cheerio.load(html); - assert.strictEqual($('pre').length, 7); + assert.equal($('pre').length, 7); }); it('Does not unescape entities', async () => { diff --git a/packages/astro/test/ssr-markdown.nodetest.js b/packages/astro/test/ssr-markdown.nodetest.js index 294611ed11bb..2d80ac7b722d 100644 --- a/packages/astro/test/ssr-markdown.nodetest.js +++ b/packages/astro/test/ssr-markdown.nodetest.js @@ -28,6 +28,6 @@ describe('Markdown pages in SSR', () => { it('Renders markdown pages correctly', async () => { const html = await fetchHTML('/post'); const $ = cheerioLoad(html); - assert.strictEqual($('#subheading').text(), 'Subheading'); + assert.equal($('#subheading').text(), 'Subheading'); }); }); diff --git a/packages/create-astro/test/context.test.js b/packages/create-astro/test/context.test.js index 654733e6c403..ab8fbadd8261 100644 --- a/packages/create-astro/test/context.test.js +++ b/packages/create-astro/test/context.test.js @@ -7,67 +7,67 @@ describe('context', () => { const ctx = await getContext([]); assert.ok(!ctx.projectName); assert.ok(!ctx.template); - assert.deepStrictEqual(ctx.skipHouston, os.platform() === 'win32'); + assert.deepEqual(ctx.skipHouston, os.platform() === 'win32'); assert.ok(!ctx.dryRun); }); it('project name', async () => { const ctx = await getContext(['foobar']); - assert.deepStrictEqual(ctx.projectName, 'foobar'); + assert.deepEqual(ctx.projectName, 'foobar'); }); it('template', async () => { const ctx = await getContext(['--template', 'minimal']); - assert.deepStrictEqual(ctx.template, 'minimal'); + assert.deepEqual(ctx.template, 'minimal'); }); it('skip houston (explicit)', async () => { const ctx = await getContext(['--skip-houston']); - assert.deepStrictEqual(ctx.skipHouston, true); + assert.deepEqual(ctx.skipHouston, true); }); it('skip houston (yes)', async () => { const ctx = await getContext(['-y']); - assert.deepStrictEqual(ctx.skipHouston, true); + assert.deepEqual(ctx.skipHouston, true); }); it('skip houston (no)', async () => { const ctx = await getContext(['-n']); - assert.deepStrictEqual(ctx.skipHouston, true); + assert.deepEqual(ctx.skipHouston, true); }); it('skip houston (install)', async () => { const ctx = await getContext(['--install']); - assert.deepStrictEqual(ctx.skipHouston, true); + assert.deepEqual(ctx.skipHouston, true); }); it('dry run', async () => { const ctx = await getContext(['--dry-run']); - assert.deepStrictEqual(ctx.dryRun, true); + assert.deepEqual(ctx.dryRun, true); }); it('install', async () => { const ctx = await getContext(['--install']); - assert.deepStrictEqual(ctx.install, true); + assert.deepEqual(ctx.install, true); }); it('no install', async () => { const ctx = await getContext(['--no-install']); - assert.deepStrictEqual(ctx.install, false); + assert.deepEqual(ctx.install, false); }); it('git', async () => { const ctx = await getContext(['--git']); - assert.deepStrictEqual(ctx.git, true); + assert.deepEqual(ctx.git, true); }); it('no git', async () => { const ctx = await getContext(['--no-git']); - assert.deepStrictEqual(ctx.git, false); + assert.deepEqual(ctx.git, false); }); it('typescript', async () => { const ctx = await getContext(['--typescript', 'strict']); - assert.deepStrictEqual(ctx.typescript, 'strict'); + assert.deepEqual(ctx.typescript, 'strict'); }); }); diff --git a/packages/integrations/node/test/well-known-locations.test.js b/packages/integrations/node/test/well-known-locations.test.js index 934673cda7e0..39d7ccedbd59 100644 --- a/packages/integrations/node/test/well-known-locations.test.js +++ b/packages/integrations/node/test/well-known-locations.test.js @@ -34,7 +34,7 @@ describe('test URIs beginning with a dot', () => { const json = await res.json(); - assert.notStrictEqual(json.applinks, {}); + assert.notEqual(json.applinks, {}); }); it('cannot load a dot folder that is not a well-known URI', async () => { diff --git a/packages/integrations/react/test/parsed-react-children.test.js b/packages/integrations/react/test/parsed-react-children.test.js index 5417705f0896..75604e5d3a8d 100644 --- a/packages/integrations/react/test/parsed-react-children.test.js +++ b/packages/integrations/react/test/parsed-react-children.test.js @@ -5,12 +5,12 @@ import convert from '../vnode-children.js'; describe('experimental react children', () => { it('has undefined as children for direct children', () => { const [imgVNode] = convert(''); - assert.deepStrictEqual(imgVNode.props.children, undefined); + assert.deepEqual(imgVNode.props.children, undefined); }); it('has undefined as children for nested children', () => { const [divVNode] = convert('
'); const [imgVNode] = divVNode.props.children; - assert.deepStrictEqual(imgVNode.props.children, undefined); + assert.deepEqual(imgVNode.props.children, undefined); }); }); diff --git a/packages/markdown/remark/test/remark-collect-images.test.js b/packages/markdown/remark/test/remark-collect-images.test.js index 77f474d94440..bc8c364680c1 100644 --- a/packages/markdown/remark/test/remark-collect-images.test.js +++ b/packages/markdown/remark/test/remark-collect-images.test.js @@ -23,7 +23,7 @@ describe('collect images', async () => { '

Hello

' ); - assert.deepStrictEqual(Array.from(imagePaths), ['./img.png']); + assert.deepEqual(Array.from(imagePaths), ['./img.png']); }); it('should add image paths from definition', async () => { @@ -37,6 +37,6 @@ describe('collect images', async () => { '

Hello

' ); - assert.deepStrictEqual(Array.from(metadata.imagePaths), ['./img.webp']); + assert.deepEqual(Array.from(metadata.imagePaths), ['./img.webp']); }); });