Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit 90d38ff

Browse files
yordisMoOx
authored andcommitted
Internal: add regression testing (#298)
1 parent 77c8dc3 commit 90d38ff

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

src/__tests__/fixtures/regression.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@custom-selector :--button .button;
2+
3+
:--button {
4+
& i {
5+
color: black;
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.button {
2+
}
3+
4+
.button i {
5+
6+
color: black
7+
}

src/__tests__/index.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import tape from "tape"
22

3+
import utils from "./utils"
34
import postcssnext from ".."
45

56
tape("postcss-cssnext is a postcss plugin", (t) => {
@@ -10,3 +11,19 @@ tape("postcss-cssnext is a postcss plugin", (t) => {
1011

1112
t.end()
1213
})
14+
15+
tape("cssnext regression test", (t) => {
16+
const input = utils.readFixture("regression")
17+
const expected = utils.readFixture("regression.expected")
18+
const actual = postcssnext().process(input).css.trim()
19+
20+
utils.write(utils.fixturePath("regression.actual"), actual)
21+
22+
t.equal(
23+
actual,
24+
expected.trim(),
25+
"should pass the regression"
26+
)
27+
28+
t.end()
29+
})

0 commit comments

Comments
 (0)