0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-27 22:19:04 -05:00

[ci] format

This commit is contained in:
Mohamed 2024-01-31 08:32:27 +00:00 committed by astrobot-houston
parent 82de54979e
commit 6dbafb8f5f
5 changed files with 44 additions and 45 deletions

View file

@ -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/');
});
});
});

View file

@ -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;

View file

@ -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/');
});
});

View file

@ -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);
});
});

View file

@ -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/');
});
});
});