-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathlayers.test.ts
More file actions
46 lines (38 loc) · 1.86 KB
/
Copy pathlayers.test.ts
File metadata and controls
46 lines (38 loc) · 1.86 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
import { describe, it, expect } from 'vitest'
import { getModuleSource, vueWebpackCompiler, reactWebpackCompiler } from './helpers'
describe("Layers test", function() {
it('should render vue', done => {
const compiler = vueWebpackCompiler('vue-layers')
compiler.run((err, stats) => {
expect(stats.compilation.errors).toStrictEqual([])
// check the windi file has generated the right classes
const windiBase = getModuleSource('virtual:windi-base.css', stats)
expect(windiBase).toContain('body {')
expect(windiBase).toMatchSnapshot('windi base')
const windiComponents = getModuleSource('virtual:windi-components.css', stats)
expect(windiComponents).toContain('windicss layer components')
expect(windiComponents).toMatchSnapshot('windi components')
const windiUtils = getModuleSource('virtual:windi-utilities.css', stats)
expect(windiUtils).toContain('bg-teal-900:hover')
expect(windiUtils).toMatchSnapshot('windi utilities')
done(err)
});
});
it('should render react', done => {
const compiler = reactWebpackCompiler('react-layers')
compiler.run((err, stats) => {
expect(stats.compilation.errors).toStrictEqual([])
// check the windi file has generated the right classes
const windiBase = getModuleSource('virtual:windi-base.css', stats)
expect(windiBase).toContain('body {')
expect(windiBase).toMatchSnapshot('windi base')
const windiComponents = getModuleSource('virtual:windi-components.css', stats)
expect(windiComponents).toContain('windicss layer components')
expect(windiComponents).toMatchSnapshot('windi components')
const windiUtils = getModuleSource('virtual:windi-utilities.css', stats)
expect(windiUtils).toContain('bg-blue-500:hover')
expect(windiUtils).toMatchSnapshot('windi utilities')
done(err)
});
});
});