From 6dbafb8f5f34d54124a564f70b1cc3d152855bf2 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Wed, 31 Jan 2024 08:32:27 +0000 Subject: [PATCH] [ci] format --- .../sitemap/test/base-path.test.js | 60 +++++++++---------- .../integrations/sitemap/test/filter.test.js | 1 - .../integrations/sitemap/test/ssr.test.js | 4 +- .../sitemap/test/staticPaths.test.js | 12 ++-- .../sitemap/test/trailing-slash.test.js | 12 ++-- 5 files changed, 44 insertions(+), 45 deletions(-) diff --git a/packages/integrations/sitemap/test/base-path.test.js b/packages/integrations/sitemap/test/base-path.test.js index 0e4ec3716c..96bf5e209b 100644 --- a/packages/integrations/sitemap/test/base-path.test.js +++ b/packages/integrations/sitemap/test/base-path.test.js @@ -3,38 +3,38 @@ import * as assert from 'node:assert/strict'; import { describe, it, before } from 'node:test'; describe('URLs with base path', () => { - /** @type {import('./test-utils').Fixture} */ - let fixture; + /** @type {import('./test-utils').Fixture} */ + let fixture; - describe('using node adapter', () => { - before(async () => { - fixture = await loadFixture({ - root: './fixtures/ssr/', - base: '/base', - }); - await fixture.build(); - }); + describe('using node adapter', () => { + before(async () => { + fixture = await loadFixture({ + root: './fixtures/ssr/', + base: '/base', + }); + await fixture.build(); + }); - it('Base path is concatenated correctly', async () => { - const data = await readXML(fixture.readFile('/client/sitemap-0.xml')); - const urls = data.urlset.url; - assert.equal(urls[0].loc[0], 'http://example.com/base/one/'); - }); - }); + it('Base path is concatenated correctly', async () => { + const data = await readXML(fixture.readFile('/client/sitemap-0.xml')); + const urls = data.urlset.url; + assert.equal(urls[0].loc[0], 'http://example.com/base/one/'); + }); + }); - describe('static', () => { - before(async () => { - fixture = await loadFixture({ - root: './fixtures/static/', - base: '/base', - }); - await fixture.build(); - }); + describe('static', () => { + before(async () => { + fixture = await loadFixture({ + root: './fixtures/static/', + base: '/base', + }); + await fixture.build(); + }); - it('Base path is concatenated correctly', async () => { - const data = await readXML(fixture.readFile('/sitemap-0.xml')); - const urls = data.urlset.url; - assert.equal(urls[0].loc[0], 'http://example.com/base/123/'); - }); - }); + it('Base path is concatenated correctly', async () => { + const data = await readXML(fixture.readFile('/sitemap-0.xml')); + const urls = data.urlset.url; + assert.equal(urls[0].loc[0], 'http://example.com/base/123/'); + }); + }); }); diff --git a/packages/integrations/sitemap/test/filter.test.js b/packages/integrations/sitemap/test/filter.test.js index de0c8deb3e..c8c00e1e75 100644 --- a/packages/integrations/sitemap/test/filter.test.js +++ b/packages/integrations/sitemap/test/filter.test.js @@ -3,7 +3,6 @@ import { sitemap } from './fixtures/static/deps.mjs'; import * as assert from 'node:assert/strict'; import { describe, it, before } from 'node:test'; - describe('Filter support', () => { /** @type {import('./test-utils.js').Fixture} */ let fixture; diff --git a/packages/integrations/sitemap/test/ssr.test.js b/packages/integrations/sitemap/test/ssr.test.js index f50bce4a49..7622f266b8 100644 --- a/packages/integrations/sitemap/test/ssr.test.js +++ b/packages/integrations/sitemap/test/ssr.test.js @@ -17,7 +17,7 @@ describe('SSR support', () => { const data = await readXML(fixture.readFile('/client/sitemap-0.xml')); const urls = data.urlset.url; - assert.equal(urls[0].loc[0],'http://example.com/one/') - assert.equal(urls[1].loc[0],'http://example.com/two/') + assert.equal(urls[0].loc[0], 'http://example.com/one/'); + assert.equal(urls[1].loc[0], 'http://example.com/two/'); }); }); diff --git a/packages/integrations/sitemap/test/staticPaths.test.js b/packages/integrations/sitemap/test/staticPaths.test.js index d74980b9e9..b4463c0d2e 100644 --- a/packages/integrations/sitemap/test/staticPaths.test.js +++ b/packages/integrations/sitemap/test/staticPaths.test.js @@ -20,24 +20,24 @@ describe('getStaticPaths support', () => { }); it('requires zero config for getStaticPaths', async () => { - assert.strictEqual(urls.includes('http://example.com/one/'),true); - assert.strictEqual(urls.includes('http://example.com/two/'),true) + assert.strictEqual(urls.includes('http://example.com/one/'), true); + assert.strictEqual(urls.includes('http://example.com/two/'), true); }); it('does not include 404 pages', () => { - assert.strictEqual(urls.includes('http://example.com/de/404/'),false); + assert.strictEqual(urls.includes('http://example.com/de/404/'), false); }); it('does not include nested 404 pages', () => { - assert.strictEqual(urls.includes('http://example.com/de/404/'),false); + assert.strictEqual(urls.includes('http://example.com/de/404/'), false); }); it('includes numerical pages', () => { - assert.strictEqual(urls.includes('http://example.com/123/'),true); + assert.strictEqual(urls.includes('http://example.com/123/'), true); }); it('should render the endpoint', async () => { const page = await fixture.readFile('./it/manifest'); - assert.strictEqual(page.includes('I\'m a route in the "it" language.'),true); + assert.strictEqual(page.includes('I\'m a route in the "it" language.'), true); }); }); diff --git a/packages/integrations/sitemap/test/trailing-slash.test.js b/packages/integrations/sitemap/test/trailing-slash.test.js index 3b3cb7762e..d51ed20203 100644 --- a/packages/integrations/sitemap/test/trailing-slash.test.js +++ b/packages/integrations/sitemap/test/trailing-slash.test.js @@ -22,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; - assert.equal(urls[0].loc[0],'http://example.com/one/'); + assert.equal(urls[0].loc[0], 'http://example.com/one/'); }); }); @@ -41,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; - assert.equal(urls[0].loc[0],'http://example.com/one'); + assert.equal(urls[0].loc[0], 'http://example.com/one'); }); }); }); @@ -58,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; - assert.equal(urls[0].loc[0],'http://example.com/one'); + assert.equal(urls[0].loc[0], 'http://example.com/one'); }); describe('with base path', () => { before(async () => { @@ -73,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; - assert.equal(urls[0].loc[0],'http://example.com/base/one'); + assert.equal(urls[0].loc[0], 'http://example.com/base/one'); }); }); }); @@ -90,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; - assert.equal(urls[0].loc[0],'http://example.com/one/'); + assert.equal(urls[0].loc[0], 'http://example.com/one/'); }); describe('with base path', () => { before(async () => { @@ -105,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; - assert.equal(urls[0].loc[0],'http://example.com/base/one/'); + assert.equal(urls[0].loc[0], 'http://example.com/base/one/'); }); }); });