Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Commit d89baaa

Browse files
committed
Add test for @apply of unknown utility classes
1 parent eedc66e commit d89baaa

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

tests/10-apply.test.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,27 @@ test('@apply', () => {
139139
})
140140
})
141141

142-
// TODO: Test stuff that should throw
142+
test('@apply error with unknown utility', async () => {
143+
let config = {
144+
// TODO: Remove this. Some kind of caching causes multiple tests in the same file to break.
145+
__name: "unknown-utility",
146+
147+
darkMode: 'class',
148+
purge: [path.resolve(__dirname, './10-apply.test.html')],
149+
corePlugins: { preflight: false },
150+
plugins: [],
151+
}
152+
153+
let css = `
154+
@tailwind components;
155+
@tailwind utilities;
156+
157+
@layer components {
158+
.foo {
159+
@apply a-utility-that-does-not-exist;
160+
}
161+
}
162+
`
163+
164+
await expect(run(css, config)).rejects.toThrowError("class does not exist")
165+
})

0 commit comments

Comments
 (0)