Skip to content

Commit

Permalink
increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Sep 7, 2024
1 parent abf7ef8 commit 9d1a389
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ jobs:
strategy:
matrix:
node: [18, 20, 'lts/*']
os: [ubuntu-latest]
include:
- os: macos-latest
node: 'lts/*'
- os: windows-latest
node: 'lts/*'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
11 changes: 11 additions & 0 deletions .test.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const plugin = require('postcss-normalize');
const postcss = require('postcss');
const assert = require('node:assert');

postcss([plugin()]).process('@import "sanitize.css"', { from: null }).then((result) => {
assert.ok(result.css.includes(':where('));
});

postcss([plugin()]).process('@import "normalize.css"', { from: null }).then((result) => {
assert.ok(result.css.includes(':where('));
});
11 changes: 11 additions & 0 deletions .test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import plugin from 'postcss-normalize';
import postcss from 'postcss';
import assert from 'node:assert';

postcss([plugin()]).process('@import "sanitize.css"', { from: null }).then((result) => {
assert.ok(result.css.includes(':where('));
});

postcss([plugin()]).process('@import "normalize.css"', { from: null }).then((result) => {
assert.ok(result.css.includes(':where('));
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"scripts": {
"prepublishOnly": "npm test",
"build": "rollup --config .rollup.mjs --silent",
"test": "npm run build && npm run tape",
"test": "npm run build && npm run tape && node .test.cjs && node .test.mjs",
"tape": "postcss-tape"
},
"engines": {
Expand Down

0 comments on commit 9d1a389

Please sign in to comment.