(name, test)
| 10 | } |
| 11 | |
| 12 | function createCompressTest(name, test) { |
| 13 | const testFn = () => { |
| 14 | const compressed = minify(test.source, test.options); |
| 15 | |
| 16 | strictEqual(normalize(compressed.css), normalize(test.compressed), 'compress by minify()'); |
| 17 | |
| 18 | const ast = parse(test.source); |
| 19 | const compressedAst = compress(ast, test.options).ast; |
| 20 | const css = generate(compressedAst); |
| 21 | |
| 22 | strictEqual(normalize(css), normalize(test.compressed), 'compress step by step'); |
| 23 | }; |
| 24 | |
| 25 | if (basename(name)[0] === '_') { |
| 26 | it.skip(name, testFn); |
| 27 | } else { |
| 28 | it(name, testFn); |
| 29 | } |
| 30 | }; |
| 31 | |
| 32 | describe('compress', () => { |
| 33 | for (const name in tests) { |
no outgoing calls
no test coverage detected
searching dependent graphs…