ff7ba0ee0f
* Ensure head content rendered once with lazy layouts * Add changeset
19 lines
526 B
JavaScript
19 lines
526 B
JavaScript
import { expect } from 'chai';
|
|
import * as cheerio from 'cheerio';
|
|
import { loadFixture } from './test-utils.js';
|
|
|
|
describe('Lazily imported layouts', () => {
|
|
/** @type {import('./test-utils').Fixture} */
|
|
let fixture;
|
|
|
|
before(async () => {
|
|
fixture = await loadFixture({ root: './fixtures/lazy-layout/' });
|
|
await fixture.build();
|
|
});
|
|
|
|
it('Renders styles only once', async () => {
|
|
const html = await fixture.readFile('/index.html');
|
|
const $ = cheerio.load(html);
|
|
expect($('link')).to.have.a.lengthOf(1);
|
|
});
|
|
});
|