Extract output constants

This commit is contained in:
Oliver Davies 2019-05-02 01:49:20 +01:00
parent 388eb307ca
commit 98021467bf

16
test.js
View file

@ -21,18 +21,19 @@ expect.extend({
})
test('it generates the correct classes with no variants', () => {
generatePluginCss().then(result => {
expect(result.css).toMatchCss(`
const output = `
.test {
display: block
}
`)
`
generatePluginCss().then(result => {
expect(result.css).toMatchCss(output)
})
})
test('it generates the correct classes with variants', () => {
generatePluginCss({ variants: ['hover', 'focus'] }).then(result => {
expect(result.css).toMatchCss(`
const output = `
.test {
display: block
}
@ -44,6 +45,9 @@ test('it generates the correct classes with variants', () => {
.focus\\:test:focus {
display: block
}
`)
`
generatePluginCss({ variants: ['hover', 'focus'] }).then(result => {
expect(result.css).toMatchCss(output)
})
})