diff options
author | 2024-01-31 17:47:33 +0800 | |
---|---|---|
committer | 2024-01-31 09:47:33 +0000 | |
commit | 8dc7b39a6203af8426ea786bd1d8ed7fd9d35003 (patch) | |
tree | 70302bfc4e0830a56af8541f89d63c5ff7c7d303 /packages/integrations/sitemap/test/trailing-slash.test.js | |
parent | 1c4a263d8f044d675b3338b77b1470af93e32ca3 (diff) | |
download | astro-8dc7b39a6203af8426ea786bd1d8ed7fd9d35003.tar.gz astro-8dc7b39a6203af8426ea786bd1d8ed7fd9d35003.tar.zst astro-8dc7b39a6203af8426ea786bd1d8ed7fd9d35003.zip |
chore(@astrojs/sitemap): migrate tests to `node:test` (#9892)
* chore(@astrojs/sitemap): migrate tests to `node:test`
* chore(@astrojs/sitemap): remove `chai` and `mocha` from devDependencies
Diffstat (limited to 'packages/integrations/sitemap/test/trailing-slash.test.js')
-rw-r--r-- | packages/integrations/sitemap/test/trailing-slash.test.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/integrations/sitemap/test/trailing-slash.test.js b/packages/integrations/sitemap/test/trailing-slash.test.js index a393fb9f1..bdedf7687 100644 --- a/packages/integrations/sitemap/test/trailing-slash.test.js +++ b/packages/integrations/sitemap/test/trailing-slash.test.js @@ -1,5 +1,6 @@ import { loadFixture, readXML } from './test-utils.js'; -import { expect } from 'chai'; +import assert from 'node:assert/strict'; +import { before, describe, it } from 'node:test'; describe('Trailing slash', () => { /** @type {import('./test-utils').Fixture} */ @@ -21,7 +22,7 @@ describe('Trailing slash', () => { it('URLs end with trailing slash', async () => { const data = await readXML(fixture.readFile('/sitemap-0.xml')); const urls = data.urlset.url; - expect(urls[0].loc[0]).to.equal('http://example.com/one/'); + assert.equal(urls[0].loc[0], 'http://example.com/one/'); }); }); @@ -40,7 +41,7 @@ describe('Trailing slash', () => { it('URLs do not end with trailing slash', async () => { const data = await readXML(fixture.readFile('/sitemap-0.xml')); const urls = data.urlset.url; - expect(urls[0].loc[0]).to.equal('http://example.com/one'); + assert.equal(urls[0].loc[0], 'http://example.com/one'); }); }); }); @@ -57,7 +58,7 @@ describe('Trailing slash', () => { it('URLs do no end with trailing slash', async () => { const data = await readXML(fixture.readFile('/sitemap-0.xml')); const urls = data.urlset.url; - expect(urls[0].loc[0]).to.equal('http://example.com/one'); + assert.equal(urls[0].loc[0], 'http://example.com/one'); }); describe('with base path', () => { before(async () => { @@ -72,7 +73,7 @@ describe('Trailing slash', () => { it('URLs do not end with trailing slash', async () => { const data = await readXML(fixture.readFile('/sitemap-0.xml')); const urls = data.urlset.url; - expect(urls[0].loc[0]).to.equal('http://example.com/base/one'); + assert.equal(urls[0].loc[0], 'http://example.com/base/one'); }); }); }); @@ -89,7 +90,7 @@ describe('Trailing slash', () => { it('URLs end with trailing slash', async () => { const data = await readXML(fixture.readFile('/sitemap-0.xml')); const urls = data.urlset.url; - expect(urls[0].loc[0]).to.equal('http://example.com/one/'); + assert.equal(urls[0].loc[0], 'http://example.com/one/'); }); describe('with base path', () => { before(async () => { @@ -104,7 +105,7 @@ describe('Trailing slash', () => { it('URLs end with trailing slash', async () => { const data = await readXML(fixture.readFile('/sitemap-0.xml')); const urls = data.urlset.url; - expect(urls[0].loc[0]).to.equal('http://example.com/base/one/'); + assert.equal(urls[0].loc[0], 'http://example.com/base/one/'); }); }); }); |