Skip to content

Commit

Permalink
refactor: change how tests are run
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Aug 16, 2023
1 parent d64b11c commit 620e1ba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
6 changes: 3 additions & 3 deletions packages/astro/test/astro-assets-prefix.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('Assets Prefix - Static', () => {
});
});

describe('Assets Prefix - Static with path prefix', () => {
describe('Assets Prefix - with path prefix', () => {
let fixture;

before(async () => {
Expand All @@ -86,7 +86,7 @@ describe('Assets Prefix - Static with path prefix', () => {
});
});

describe('Assets Prefix - Server', () => {
describe('Assets Prefix, server', () => {
let app;

before(async () => {
Expand Down Expand Up @@ -143,7 +143,7 @@ describe('Assets Prefix - Server', () => {
});
});

describe('Assets Prefix - Server with path prefix', () => {
describe('Assets Prefix, with path prefix', () => {
let app;

before(async () => {
Expand Down
28 changes: 15 additions & 13 deletions packages/astro/test/ssr-hoisted-script.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ describe('Hoisted scripts in SSR', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;

before(async () => {
fixture = await loadFixture({
root: './fixtures/ssr-hoisted-script/',
output: 'server',
adapter: testAdapter(),
});
await fixture.build();
});

async function fetchHTML(path) {
const app = await fixture.loadTestAdapterApp();
const request = new Request('http://example.com' + path);
Expand All @@ -24,10 +15,21 @@ describe('Hoisted scripts in SSR', () => {
return html;
}

it('Inlined scripts get included', async () => {
const html = await fetchHTML('/');
const $ = cheerioLoad(html);
expect($('script').length).to.equal(1);
describe('without base path', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/ssr-hoisted-script/',
output: 'server',
adapter: testAdapter(),
});
await fixture.build();
});

it('Inlined scripts get included', async () => {
const html = await fetchHTML('/');
const $ = cheerioLoad(html);
expect($('script').length).to.equal(1);
});
});

describe('base path', () => {
Expand Down

0 comments on commit 620e1ba

Please sign in to comment.