Fix styles-ssr timeout (#1891)
This commit is contained in:
parent
637cf499fa
commit
36f2f5d33e
1 changed files with 16 additions and 18 deletions
|
@ -2,27 +2,25 @@ import { expect } from 'chai';
|
||||||
import cheerio from 'cheerio';
|
import cheerio from 'cheerio';
|
||||||
import { loadFixture } from './test-utils.js';
|
import { loadFixture } from './test-utils.js';
|
||||||
|
|
||||||
describe('Styles SSR', function () {
|
let fixture;
|
||||||
this.timeout(10000);
|
let index$;
|
||||||
|
let bundledCSS;
|
||||||
|
|
||||||
let fixture;
|
before(async () => {
|
||||||
let index$;
|
fixture = await loadFixture({
|
||||||
let bundledCSS;
|
projectRoot: './fixtures/astro-styles-ssr/',
|
||||||
|
renderers: ['@astrojs/renderer-react', '@astrojs/renderer-svelte', '@astrojs/renderer-vue'],
|
||||||
before(async () => {
|
|
||||||
fixture = await loadFixture({
|
|
||||||
projectRoot: './fixtures/astro-styles-ssr/',
|
|
||||||
renderers: ['@astrojs/renderer-react', '@astrojs/renderer-svelte', '@astrojs/renderer-vue'],
|
|
||||||
});
|
|
||||||
await fixture.build();
|
|
||||||
|
|
||||||
// get bundled CSS (will be hashed, hence DOM query)
|
|
||||||
const html = await fixture.readFile('/index.html');
|
|
||||||
index$ = cheerio.load(html);
|
|
||||||
const bundledCSSHREF = index$('link[rel=stylesheet][href^=assets/]').attr('href');
|
|
||||||
bundledCSS = await fixture.readFile(bundledCSSHREF.replace(/^\/?/, '/'));
|
|
||||||
});
|
});
|
||||||
|
await fixture.build();
|
||||||
|
|
||||||
|
// get bundled CSS (will be hashed, hence DOM query)
|
||||||
|
const html = await fixture.readFile('/index.html');
|
||||||
|
index$ = cheerio.load(html);
|
||||||
|
const bundledCSSHREF = index$('link[rel=stylesheet][href^=assets/]').attr('href');
|
||||||
|
bundledCSS = await fixture.readFile(bundledCSSHREF.replace(/^\/?/, '/'));
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Styles SSR', function () {
|
||||||
describe('Astro styles', () => {
|
describe('Astro styles', () => {
|
||||||
it('HTML and CSS scoped correctly', async () => {
|
it('HTML and CSS scoped correctly', async () => {
|
||||||
const $ = index$;
|
const $ = index$;
|
||||||
|
|
Loading…
Add table
Reference in a new issue