Add test for optional prefix

This commit is contained in:
Rouven Hurling 2018-09-14 15:20:29 +02:00 committed by GitHub
parent f629b647da
commit f8dfd04600
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)
})
})