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
Emanuele Stoppa 062623438b
chore: use biome to sort imports - only test files (#10180)
* chore: use biome to sort imports

* do the sorting

* Update package.json

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>

---------

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2024-02-21 14:08:19 +00:00

37 lines
932 B
JavaScript

import * as assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
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}`);
}
}
assert.equal(css.includes('box-sizing:border-box;'), true); // base css
assert.equal(css.includes('text-red-500'), true); // class css
assert.equal(
new RegExp(/\.a\[data-astro-cid-.*?\] \.b\[data-astro-cid-.*?\]/).test(css),
true
); // nesting
});
});
});