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