From fee47f6414cc3ae9a88f3ee0ed20f1d6f2d9f556 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 14 Oct 2023 15:58:02 +0800 Subject: added plugin from postcss: postcss-fixes rucksack-css --- node_modules/postcss-hexrgba/test/test.js | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 node_modules/postcss-hexrgba/test/test.js (limited to 'node_modules/postcss-hexrgba/test/test.js') 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)); + +}); -- cgit v1.2.3