Add test for optional prefix

This commit is contained in:
Rouven Hurling 2018-09-14 15:20:29 +02:00 • committed by Adam Wathan
parent a38c785350
commit e1e3cb677a

View file

@ -192,3 +192,26 @@ test('you can apply utility classes that do not actually exist as long as they w
expect(result.warnings().length).toBe(0)
})
})
test('you can apply utility classes without using the given prefix', () => {
const input = `
.foo { @apply .mt-4; }
`
const expected = `
.prefix-foo { margin-top: 1rem; }
`
const config = {
...defaultConfig,
options: {
...defaultConfig.options,
prefix: 'prefix',
},
}
return run(input, config).then(result => {
expect(result.css).toEqual(expected)
expect(result.warnings().length).toBe(0)
})
})