Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up tests #9183

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was never run as it didn't have the .test.js postfix. I added it but it failed here, which I fixed it by passing site here.

})
).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
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