MCPcopy
hub / github.com/css/csso / createCompressTest

Function createCompressTest

test/compress.js:12–30  ·  view source on GitHub ↗
(name, test)

Source from the content-addressed store, hash-verified

10}
11
12function 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
32describe('compress', () => {
33 for (const name in tests) {

Callers 1

compress.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…