summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Mohamed <ematipico@users.noreply.github.com> 2024-01-31 08:32:27 +0000
committerGravatar astrobot-houston <fred+astrobot@astro.build> 2024-01-31 08:32:27 +0000
commit6dbafb8f5f34d54124a564f70b1cc3d152855bf2 (patch)
tree5aebf81daa1f0d0eb2ab3a4226c10f8af940c843
parent82de54979e90f7f46b832cf5ae88fcc5fed43568 (diff)
downloadastro-6dbafb8f5f34d54124a564f70b1cc3d152855bf2.tar.gz
astro-6dbafb8f5f34d54124a564f70b1cc3d152855bf2.tar.zst
astro-6dbafb8f5f34d54124a564f70b1cc3d152855bf2.zip
[ci] format
-rw-r--r--packages/integrations/sitemap/test/base-path.test.js60
-rw-r--r--packages/integrations/sitemap/test/filter.test.js1
-rw-r--r--packages/integrations/sitemap/test/ssr.test.js4
-rw-r--r--packages/integrations/sitemap/test/staticPaths.test.js12
-rw-r--r--packages/integrations/sitemap/test/trailing-slash.test.js12
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 0e4ec3716..96bf5e209 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 de0c8deb3..c8c00e1e7 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 f50bce4a4..7622f266b 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 d74980b9e..b4463c0d2 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 3b3cb7762..d51ed2020 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/');
});
});
});