* Treeshake exported client components that are not imported * Fix plugin name * Fix mdx test
20 lines
660 B
JavaScript
20 lines
660 B
JavaScript
import { expect } from 'chai';
|
|
import { loadFixture } from './test-utils.js';
|
|
|
|
describe('Component bundling', () => {
|
|
let fixture;
|
|
|
|
before(async () => {
|
|
fixture = await loadFixture({ root: './fixtures/astro-component-bundling/' });
|
|
await fixture.build();
|
|
});
|
|
|
|
it('should treeshake FooComponent', async () => {
|
|
const astroChunkDir = await fixture.readdir('/_astro');
|
|
const manyComponentsChunkName = astroChunkDir.find((chunk) =>
|
|
chunk.startsWith('ManyComponents')
|
|
);
|
|
const manyComponentsChunkContent = await fixture.readFile(`/_astro/${manyComponentsChunkName}`);
|
|
expect(manyComponentsChunkContent).to.not.include('FooComponent');
|
|
});
|
|
});
|