Skip to content

Commit 1ee6b18

Browse files
committed
parse at-rule prelude
1 parent 9350eae commit 1ee6b18

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

test/specs/angle.spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* generate from test/specs/block.spec.ts */
2+
import {expect as f} from '../../node_modules/@esm-bundle/chai/esm/chai.js';
3+
import {parse, render} from '../../dist/index.js';
4+
5+
describe('Parse angle', function () {
6+
7+
it('angle #1', function () {
8+
return parse(`.transform { transform: rotate(12deg, 1.57rad, 100grad); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.transform {
9+
transform: rotate(12deg,1.57rad,100grad)
10+
}`));
11+
});
12+
});

test/specs/color.spec.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* generate from test/specs/block.spec.ts */
2+
import {expect as f} from '../../node_modules/@esm-bundle/chai/esm/chai.js';
3+
import {parse, render} from '../../dist/index.js';
4+
5+
describe('Parse color', function () {
6+
7+
it('hsl #1', function () {
8+
return parse(`.hsl { color: hsl(195, 100%, 50%); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.hsl {
9+
color: #00bfff
10+
}`));
11+
});
12+
13+
it('hsl #2', function () {
14+
return parse(`.hsl { color: hsla(195, 100%, 50%, 50%); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.hsl {
15+
color: #00bfff80
16+
}`));
17+
});
18+
it('hwb #3', function () {
19+
return parse(`.hwb { color: hwb(195, 0%, 0%); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.hwb {
20+
color: #00bfff
21+
}`));
22+
});
23+
24+
it('hwb #4', function () {
25+
return parse(`.hwb { color: hwb(195, 0%, 0%, 50%); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.hwb {
26+
color: #00bfff80
27+
}`));
28+
});
29+
});

0 commit comments

Comments
 (0)