astro/packages/astro/test/unused-slot.test.js
Matthew Phillips d588bc4a9c
Update rollup to prevent empty slot bug (#3496)
* Update rollup to prevent empty slot bug

* Adds a changeset

* Updated lockfile

* provide import.meta.env.SITE when there are private envs
2022-06-01 12:21:32 -04:00

19 lines
528 B
JavaScript

import { expect } from 'chai';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
describe('Unused slot', () => {
let fixture;
before(async () => {
fixture = await loadFixture({ root: './fixtures/unused-slot/' });
await fixture.build();
});
it('is able to build with the slot missing', async () => {
let html = await fixture.readFile('/index.html');
let $ = cheerio.load(html);
// No children, slot rendered as empty
expect($('body p').children().length).to.equal(0);
});
});