diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:58:02 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:58:02 +0800 |
| commit | fee47f6414cc3ae9a88f3ee0ed20f1d6f2d9f556 (patch) | |
| tree | 2b99dd57fc676a3819ef3cc46ac43df0043c2bb3 /node_modules/postcss-hexrgba/test/test.js | |
| parent | 0379526e20e1ff212df23e6326741aa9c06df204 (diff) | |
added plugin from postcss: postcss-fixes rucksack-css
Diffstat (limited to 'node_modules/postcss-hexrgba/test/test.js')
| -rw-r--r-- | node_modules/postcss-hexrgba/test/test.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/node_modules/postcss-hexrgba/test/test.js b/node_modules/postcss-hexrgba/test/test.js new file mode 100644 index 00000000..ad54cd2c --- /dev/null +++ b/node_modules/postcss-hexrgba/test/test.js @@ -0,0 +1,37 @@ +'use strict'; + +const postcss = require('postcss'); +const expect = require('chai').expect; +const fs = require('fs'); +const path = require('path'); +const plugin = require('../'); + +function test(fixture, opts, done) { + let input = fixture + '.css', + expected = fixture + '.expected.css'; + + input = fs.readFileSync(path.join(__dirname, 'fixtures', input), 'utf8'); + expected = fs.readFileSync(path.join(__dirname, 'fixtures', expected), 'utf8'); + + postcss([ plugin(opts) ]) + .process(input) + .then(result => { + expect(result.css).to.eql(expected); + expect(result.warnings()).to.be.empty; + done(); + }).catch(error => done(error)); +} + +describe('postcss-hexrgba', () => { + + it('handles standard hex', done => test('standard', {}, done)); + + it('handles shorthand hex', done => test('shorthand', {}, done)); + + it('handles hex in multiple attributes', done => test('multiple', {}, done)); + + it('handles complex statements', done => test('complex', {}, done)); + + it('preservers !important', done => test('important', {}, done)); + +}); |
