Skip to content

Commit e1e3cb6

Browse files
rhurlingadamwathan
authored andcommitted
Add test for optional prefix
1 parent a38c785 commit e1e3cb6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

__tests__/applyAtRule.test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,26 @@ test('you can apply utility classes that do not actually exist as long as they w
192192
expect(result.warnings().length).toBe(0)
193193
})
194194
})
195+
196+
test('you can apply utility classes without using the given prefix', () => {
197+
const input = `
198+
.foo { @apply .mt-4; }
199+
`
200+
201+
const expected = `
202+
.prefix-foo { margin-top: 1rem; }
203+
`
204+
205+
const config = {
206+
...defaultConfig,
207+
options: {
208+
...defaultConfig.options,
209+
prefix: 'prefix',
210+
},
211+
}
212+
213+
return run(input, config).then(result => {
214+
expect(result.css).toEqual(expected)
215+
expect(result.warnings().length).toBe(0)
216+
})
217+
})

0 commit comments

Comments
 (0)