diff --git a/test/specs/angle.spec.js b/test/specs/angle.spec.js new file mode 100644 index 0000000..5d3131f --- /dev/null +++ b/test/specs/angle.spec.js @@ -0,0 +1,12 @@ +/* generate from test/specs/block.spec.ts */ +import {expect as f} from '../../node_modules/@esm-bundle/chai/esm/chai.js'; +import {parse, render} from '../../dist/index.js'; + +describe('Parse angle', function () { + + it('angle #1', function () { + return parse(`.transform { transform: rotate(12deg, 1.57rad, 100grad); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.transform { + transform: rotate(12deg,1.57rad,100grad) +}`)); + }); +}); \ No newline at end of file diff --git a/test/specs/color.spec.js b/test/specs/color.spec.js new file mode 100644 index 0000000..83e10f2 --- /dev/null +++ b/test/specs/color.spec.js @@ -0,0 +1,29 @@ +/* generate from test/specs/block.spec.ts */ +import {expect as f} from '../../node_modules/@esm-bundle/chai/esm/chai.js'; +import {parse, render} from '../../dist/index.js'; + +describe('Parse color', function () { + + it('hsl #1', function () { + return parse(`.hsl { color: hsl(195, 100%, 50%); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.hsl { + color: #00bfff +}`)); + }); + + it('hsl #2', function () { + return parse(`.hsl { color: hsla(195, 100%, 50%, 50%); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.hsl { + color: #00bfff80 +}`)); + }); + it('hwb #3', function () { + return parse(`.hwb { color: hwb(195, 0%, 0%); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.hwb { + color: #00bfff +}`)); + }); + + it('hwb #4', function () { + return parse(`.hwb { color: hwb(195, 0%, 0%, 50%); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.hwb { + color: #00bfff80 +}`)); + }); +});