0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/packages/integrations/tailwind/test/basic.test.js
Bjorn Lu d252fc61b0
Add tailwindcss nesting support (#9529)
* Add tailwindcss nesting support

* Update lockfile
2023-12-27 12:34:01 -05:00

33 lines
814 B
JavaScript

import { expect } from 'chai';
import { loadFixture } from '../../../astro/test/test-utils.js';
describe('Basic', () => {
let fixture;
before(async () => {
fixture = await loadFixture({
root: new URL('./fixtures/basic/', import.meta.url),
});
});
describe('build', () => {
before(async () => {
await fixture.build();
});
it('works', async () => {
const astroChunkDir = await fixture.readdir('/_astro');
let css = '';
for (const file of astroChunkDir) {
if (file.endsWith('.css')) {
css += await fixture.readFile(`/_astro/${file}`);
}
}
expect(css).to.include('box-sizing:border-box;'); // base css
expect(css).to.include('text-red-500'); // class css
expect(css).to.match(/\.a\[data-astro-cid-.*?\] \.b\[data-astro-cid-.*?\]/); // nesting
});
});
});