|
1 |
| -import { useTestContext } from '@nuxt/test-utils' |
2 |
| -import { describe, test, expect, vi, afterAll } from 'vitest' |
| 1 | +import { describe, test, expect } from 'vitest' |
3 | 2 | import { getVfsFile, r, setupNuxtTailwind } from './utils'
|
4 | 3 |
|
5 | 4 | describe('tailwindcss module', async () => {
|
6 |
| - // Consola will by default set the log level to warn in test, we trick it into thinking we're in debug mode |
7 |
| - process.env.DEBUG = 'nuxt:*' |
8 |
| - // // Running dev environment for setup in test-utils to test dev options |
9 |
| - // process.env.NUXT_TEST_DEV = true |
10 |
| - |
11 |
| - const spyStderr = vi.spyOn(process.stderr, 'write').mockImplementation(() => undefined!) |
12 |
| - const spyStdout = vi.spyOn(process.stdout, 'write').mockImplementation(() => undefined!) |
13 |
| - |
14 |
| - afterAll(() => { |
15 |
| - spyStderr.mockRestore() |
16 |
| - spyStdout.mockRestore() |
17 |
| - }) |
18 |
| - |
19 | 5 | await setupNuxtTailwind({
|
20 | 6 | exposeConfig: { level: 2, alias: '#twcss' },
|
21 | 7 | quiet: false,
|
22 | 8 | // viewer: { endpoint: '_tw' },
|
23 | 9 | cssPath: r('tailwind.css'),
|
24 | 10 | })
|
25 | 11 |
|
26 |
| - test('include custom tailwind.css file in project css', () => { |
27 |
| - const nuxt = useTestContext().nuxt! |
28 |
| - |
29 |
| - expect(nuxt.options.css).toHaveLength(1) |
30 |
| - expect(nuxt.options.css[0]).toEqual( |
31 |
| - // @ts-expect-error tailwindcss is not typed |
32 |
| - (nuxt.options.tailwindcss.cssPath as string).replace(/\\/g /* windows protocol */, '/'), |
33 |
| - ) |
34 |
| - |
35 |
| - expect(spyStdout.mock.calls.some(c => (c[0] as string).includes('Using Tailwind CSS from ~/tailwind.css'))).toBeTruthy() |
36 |
| - }) |
37 |
| - |
38 | 12 | test('default js config is merged in', () => {
|
39 | 13 | const vfsFile = getVfsFile('test-tailwind.config.mjs')
|
40 | 14 | // set from default config tailwind.config.js
|
|
0 commit comments