summaryrefslogtreecommitdiff
path: root/packages/integrations/tailwind/test/basic.test.js
blob: e5275c81e9d68d1d1ea41416772ba6a1e295ef6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
		});
	});
});