Skip to content

Commit bbd55f4

Browse files
committed
add tests with "old" config, to ensure it keeps working
1 parent 4680dcc commit bbd55f4

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

tests/normalize-config.test.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,52 @@ it.each`
4646
`)
4747
})
4848
})
49+
50+
it('should still be possible to use the "old" v2 config', () => {
51+
let config = {
52+
purge: {
53+
content: [
54+
{ raw: 'text-svelte', extension: 'svelte' },
55+
{ raw: '# My Big Heading', extension: 'md' },
56+
],
57+
options: {
58+
defaultExtractor(content) {
59+
return content.split(' ').concat(['font-bold'])
60+
},
61+
},
62+
extract: {
63+
svelte(content) {
64+
return content.replace('svelte', 'center').split(' ')
65+
},
66+
},
67+
transform: {
68+
md() {
69+
return 'text-4xl'
70+
},
71+
},
72+
},
73+
theme: {
74+
extends: {},
75+
},
76+
variants: {
77+
extends: {},
78+
},
79+
}
80+
81+
return run('@tailwind utilities', config).then((result) => {
82+
return expect(result.css).toMatchFormattedCss(css`
83+
.text-center {
84+
text-align: center;
85+
}
86+
87+
.text-4xl {
88+
font-size: 2.25rem;
89+
line-height: 2.5rem;
90+
}
91+
92+
.font-bold {
93+
font-weight: 700;
94+
}
95+
`)
96+
})
97+
})

0 commit comments

Comments
 (0)