Skip to content

Commit 9d1a389

Browse files
committed
increase test coverage
1 parent abf7ef8 commit 9d1a389

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

.github/workflows/test.yml

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ jobs:
1212
strategy:
1313
matrix:
1414
node: [18, 20, 'lts/*']
15+
os: [ubuntu-latest]
16+
include:
17+
- os: macos-latest
18+
node: 'lts/*'
19+
- os: windows-latest
20+
node: 'lts/*'
1521
steps:
1622
- uses: actions/checkout@v4
1723
- uses: actions/setup-node@v4

.test.cjs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const plugin = require('postcss-normalize');
2+
const postcss = require('postcss');
3+
const assert = require('node:assert');
4+
5+
postcss([plugin()]).process('@import "sanitize.css"', { from: null }).then((result) => {
6+
assert.ok(result.css.includes(':where('));
7+
});
8+
9+
postcss([plugin()]).process('@import "normalize.css"', { from: null }).then((result) => {
10+
assert.ok(result.css.includes(':where('));
11+
});

.test.mjs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import plugin from 'postcss-normalize';
2+
import postcss from 'postcss';
3+
import assert from 'node:assert';
4+
5+
postcss([plugin()]).process('@import "sanitize.css"', { from: null }).then((result) => {
6+
assert.ok(result.css.includes(':where('));
7+
});
8+
9+
postcss([plugin()]).process('@import "normalize.css"', { from: null }).then((result) => {
10+
assert.ok(result.css.includes(':where('));
11+
});

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"scripts": {
2424
"prepublishOnly": "npm test",
2525
"build": "rollup --config .rollup.mjs --silent",
26-
"test": "npm run build && npm run tape",
26+
"test": "npm run build && npm run tape && node .test.cjs && node .test.mjs",
2727
"tape": "postcss-tape"
2828
},
2929
"engines": {

0 commit comments

Comments
 (0)