Extract output constants

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

40
test.js
View file

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