Skip to content

Commit

Permalink
Clean up tests (#9183)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Nov 27, 2023
1 parent 2ef75fe commit 328d999
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion packages/astro/e2e/react-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ test.describe('React client id generation', () => {
const hydratedId1 = await components.nth(2).getAttribute('id');
const clientOnlyId0 = await components.nth(3).getAttribute('id');
const clientOnlyId1 = await components.nth(4).getAttribute('id');
console.log('ho ho', staticId, hydratedId0, hydratedId1, clientOnlyId0, clientOnlyId1);
expect(staticId).not.toEqual(hydratedId0);
expect(hydratedId0).not.toEqual(hydratedId1);
expect(hydratedId1).not.toEqual(clientOnlyId0);
Expand Down
6 changes: 2 additions & 4 deletions packages/astro/test/i18n-routing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,6 @@ describe('[SSG] i18n routing', () => {

it('should render the en locale', async () => {
let html = await fixture.readFile('/index.html');
let $ = cheerio.load(html);
expect(html).to.include('http-equiv="refresh');
expect(html).to.include('Redirecting to: /en');
});
Expand Down Expand Up @@ -953,9 +952,8 @@ describe('[SSR] i18n routing', () => {
it('should redirect to the english locale, which is the first fallback', async () => {
let request = new Request('http://example.com/new-site/it/start');
let response = await app.render(request);
console.log(await response.text());
// expect(response.status).to.equal(302);
// expect(response.headers.get('location')).to.equal('/new-site/start');
expect(response.status).to.equal(302);
expect(response.headers.get('location')).to.equal('/new-site/start');
});

it("should render a 404 because the route `fr` isn't included in the list of locales of the configuration", async () => {
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion packages/astro/test/ssr-split-manifest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ describe('astro:ssr-manifest, split', () => {
const request = new Request('http://example.com/');
const response = await app.render(request);
const html = await response.text();
console.log(html);
expect(html.includes('<title>Testing</title>')).to.be.true;
});
});
Expand Down
1 change: 0 additions & 1 deletion packages/astro/test/units/dev/dev.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ describe('dev container', () => {
container.handle(r.req, r.res);
await r.done;
const doc = await r.text();
console.log(doc);
expect(doc).to.match(/Regular page/);
expect(r.res.statusCode).to.equal(200);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ describe('getLocaleAbsoluteUrl', () => {
...config.experimental.i18n,
trailingSlash: 'never',
format: 'directory',
site: 'https://example.com',
})
).to.eq('https://example.com/blog');
expect(
Expand All @@ -645,6 +646,7 @@ describe('getLocaleAbsoluteUrl', () => {
...config.experimental.i18n,
trailingSlash: 'always',
format: 'directory',
site: 'https://example.com',
})
).to.eq('https://example.com/blog/es/');

Expand All @@ -655,6 +657,7 @@ describe('getLocaleAbsoluteUrl', () => {
...config.experimental.i18n,
trailingSlash: 'ignore',
format: 'directory',
site: 'https://example.com',
})
).to.eq('https://example.com/blog/');

Expand All @@ -666,6 +669,7 @@ describe('getLocaleAbsoluteUrl', () => {
...config.experimental.i18n,
trailingSlash: 'never',
format: 'file',
site: 'https://example.com',
})
).to.eq('https://example.com/blog');
expect(
Expand All @@ -675,6 +679,7 @@ describe('getLocaleAbsoluteUrl', () => {
...config.experimental.i18n,
trailingSlash: 'always',
format: 'file',
site: 'https://example.com',
})
).to.eq('https://example.com/blog/es/');

Expand All @@ -686,6 +691,7 @@ describe('getLocaleAbsoluteUrl', () => {
...config.experimental.i18n,
trailingSlash: 'ignore',
format: 'file',
site: 'https://example.com',
})
).to.eq('https://example.com/blog');
});
Expand Down
1 change: 0 additions & 1 deletion packages/create-astro/test/typescript.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { fileURLToPath } from 'node:url';

import { typescript, setupTypeScript } from '../dist/index.js';
import { setup, resetFixtures } from './utils.js';
import { describe } from 'node:test';

describe('typescript', () => {
const fixture = setup();
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/integrations/node/test/bad-urls.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai';
import nodejs from '../dist/index.js';
import { loadFixture } from './test-utils.js';

describe('API routes', () => {
describe('Bad URLs', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
let devPreview;
Expand Down

0 comments on commit 328d999

Please sign in to comment.