From 98021467bfdd886af541bd2def46c0592339d0bf Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 2 May 2019 01:49:20 +0100 Subject: [PATCH] Extract output constants --- test.js | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/test.js b/test.js index e51092b..4911670 100644 --- a/test.js +++ b/test.js @@ -21,29 +21,33 @@ expect.extend({ }) test('it generates the correct classes with no variants', () => { + const output = ` + .test { + display: block + } + ` + generatePluginCss().then(result => { - expect(result.css).toMatchCss(` - .test { - display: block - } - `) + expect(result.css).toMatchCss(output) }) }) 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 => { - expect(result.css).toMatchCss(` - .test { - display: block - } - - .hover\\:test:hover { - display: block - } - - .focus\\:test:focus { - display: block - } - `) + expect(result.css).toMatchCss(output) }) })