Skip to content

Commit b15603c

Browse files
authored
use node:test in postcss-tape (#1224)
1 parent a1755b6 commit b15603c

File tree

200 files changed

+2051
-2435
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+2051
-2435
lines changed

.github/bin/new-plugin.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ console.log(`- Creating new plugin ${pluginName}`);
5252
await replaceBasePluginReferencesForFilePath(path.join(pluginDir, 'src', 'index.ts'));
5353
await replaceBasePluginReferencesForFilePath(path.join(pluginDir, 'test', '_import.mjs'));
5454
await replaceBasePluginReferencesForFilePath(path.join(pluginDir, 'test', '_require.cjs'));
55-
await replaceBasePluginReferencesForFilePath(path.join(pluginDir, '.tape.mjs'));
55+
await replaceBasePluginReferencesForFilePath(path.join(pluginDir, 'test', '_tape.mjs'));
5656
await replaceBasePluginReferencesForFilePath(path.join(pluginDir, 'README.md'));
5757
await replaceBasePluginReferencesForFilePath(path.join(pluginDir, 'INSTALL.md'));
5858
await fsp.writeFile(

.github/workflows/test.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ jobs:
4040

4141
- name: npm ci
4242
run: |
43-
npm ci --ignore-scripts
43+
npm ci
44+
env:
45+
BROWSER_TESTS: true
4446
if: ${{ (matrix.is_base_node_version && matrix.is_base_os_version) }}
4547

4648
- name: npm ci
@@ -85,14 +87,6 @@ jobs:
8587
NPM_CONFIG_ENGINE_STRICT=false npm install --ignore-scripts
8688
npm run test:cli --if-present $MODIFIED_WORKSPACES
8789
88-
# Browser Tests
89-
# running "npm ci" again, but allowing scripts so that Chrome is installed
90-
- name: test:browser
91-
run: |
92-
npm ci
93-
npm run test:browser --if-present $MODIFIED_WORKSPACES
94-
if: matrix.is_base_node_version && matrix.is_base_os_version
95-
9690
# E2E Tests
9791
- name: test:e2e
9892
run: |

experimental/css-has-pseudo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
"lint": "node ../../.github/bin/format-package-json.mjs",
5757
"prepublishOnly": "npm run build && npm run test",
5858
"stryker": "stryker run --logLevel error",
59-
"test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs",
60-
"test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs"
59+
"test": "node --test",
60+
"test:rewrite-expects": "REWRITE_EXPECTS=true node --test"
6161
},
6262
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/experimental/css-has-pseudo#readme",
6363
"repository": {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { postcssTape } from '@csstools/postcss-tape';
22
import plugin from '@csstools/css-has-pseudo-experimental';
33

4-
postcssTape(plugin)({
4+
postcssTape(plugin, { skipPackageNameCheck: true })({
55
'basic': {
66
message: 'supports basic usage',
7-
warnings: 1
7+
warnings: 1,
88
},
99
});

experimental/postcss-gradient-stop-increments/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
"docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs",
6464
"lint": "node ../../.github/bin/format-package-json.mjs",
6565
"prepublishOnly": "npm run build && npm run test",
66-
"test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs",
67-
"test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs"
66+
"test": "node --test",
67+
"test:rewrite-expects": "REWRITE_EXPECTS=true node --test"
6868
},
6969
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gradient-stop-increments#readme",
7070
"repository": {

experimental/postcss-gradient-stop-increments/.tape.mjs renamed to experimental/postcss-gradient-stop-increments/test/_tape.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import plugin from '@csstools/postcss-gradient-stop-increments-experimental';
33

44
postcssTape(plugin)({
55
basic: {
6-
message: "supports basic usage",
6+
message: 'supports basic usage',
77
},
88
'examples/example': {
99
message: 'minimal example',
1010
},
1111
'examples/example:preserve-true': {
1212
message: 'minimal example',
1313
options: {
14-
preserve: true
15-
}
14+
preserve: true,
15+
},
1616
},
1717
});

experimental/postcss-nesting/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
"docs": "node ../../.github/bin/generate-docs/install.mjs",
5050
"lint": "node ../../.github/bin/format-package-json.mjs",
5151
"prepublishOnly": "npm run build && npm run test",
52-
"test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs",
53-
"test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs"
52+
"test": "node --test",
53+
"test:rewrite-expects": "REWRITE_EXPECTS=true node --test"
5454
},
5555
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting#readme",
5656
"repository": {

experimental/postcss-nesting/.tape.mjs renamed to experimental/postcss-nesting/test/_tape.mjs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ const mixinPluginRule = () => {
99
node.replaceWith(postcss.parse('& .in{ &.deep { color: blue; }}', {from : 'mixin.css'}));
1010
},
1111
},
12-
}
13-
}
12+
};
13+
};
1414

15-
mixinPluginRule.postcss = true
15+
mixinPluginRule.postcss = true;
1616

1717
const mixinPluginDeclaration = () => {
1818
return {
@@ -22,10 +22,10 @@ const mixinPluginDeclaration = () => {
2222
node.replaceWith(postcss.parse('color: blue;', {from : 'mixin.css'}));
2323
},
2424
},
25-
}
26-
}
25+
};
26+
};
2727

28-
mixinPluginDeclaration.postcss = true
28+
mixinPluginDeclaration.postcss = true;
2929

3030
postcssTape(plugin)({
3131
'basic': {
@@ -54,7 +54,7 @@ postcssTape(plugin)({
5454
},
5555
'invalid-selector': {
5656
message: 'warns on invalid selectors',
57-
warnings: 2
57+
warnings: 2,
5858
},
5959
'media': {
6060
message: 'supports nested @media',
@@ -80,11 +80,11 @@ postcssTape(plugin)({
8080
},
8181
'mixin-declaration': {
8282
message: 'supports other visitors (mixin declaration)',
83-
plugins: [mixinPluginDeclaration(), plugin()]
83+
plugins: [mixinPluginDeclaration(), plugin()],
8484
},
8585
'mixin-rule': {
8686
message: 'supports other visitors (mixin rule)',
87-
plugins: [mixinPluginRule(), plugin()]
87+
plugins: [mixinPluginRule(), plugin()],
8888
},
8989
'spec-examples': {
9090
message: 'supports all spec examples',
@@ -98,5 +98,5 @@ postcssTape(plugin)({
9898
},
9999
'ampersand-everywhere': {
100100
message: 'allow & to be used everywhere',
101-
}
101+
},
102102
});

knip.json

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
99
},
1010
"packages/*": {
1111
"entry": [
12-
".tape.{cjs,mjs}",
1312
"scripts/**/*.mjs",
1413
"src/index.ts",
15-
"test/_import.mjs",
16-
"test/_require.cjs",
17-
"test/test.mjs"
14+
"test/**/*.{cjs,mjs}"
1815
],
1916
"project": [
2017
"**/*.{ts,js,mjs}",
@@ -23,10 +20,8 @@
2320
},
2421
"plugins/postcss-design-tokens": {
2522
"entry": [
26-
".tape.{cjs,mjs}",
2723
"src/index.ts",
28-
"test/_import.mjs",
29-
"test/_require.cjs"
24+
"test/**/*.{cjs,mjs}"
3025
],
3126
"project": [
3227
"**/*.ts",
@@ -38,10 +33,8 @@
3833
},
3934
"plugins/postcss-global-data": {
4035
"entry": [
41-
".tape.{cjs,mjs}",
4236
"src/index.ts",
43-
"test/_import.mjs",
44-
"test/_require.cjs"
37+
"test/**/*.{cjs,mjs}"
4538
],
4639
"project": [
4740
"**/*.ts",
@@ -53,15 +46,12 @@
5346
},
5447
"plugins/*": {
5548
"entry": [
56-
".tape.{cjs,mjs}",
5749
"scripts/**/*.mjs",
5850
"src/browser-global.js",
5951
"src/browser.js",
6052
"src/index.js",
6153
"src/index.ts",
62-
"test/_import.mjs",
63-
"test/_require.cjs",
64-
"test/test.mjs"
54+
"test/**/*.{cjs,mjs}"
6555
],
6656
"project": [
6757
"**/*.{ts,js,mjs}",
@@ -70,15 +60,12 @@
7060
},
7161
"experimental/*": {
7262
"entry": [
73-
".tape.{cjs,mjs}",
7463
"scripts/**/*.mjs",
7564
"src/browser-global.js",
7665
"src/browser.js",
7766
"src/index.js",
7867
"src/index.ts",
79-
"test/_import.mjs",
80-
"test/_require.cjs",
81-
"test/test.mjs"
68+
"test/**/*.{cjs,mjs}"
8269
],
8370
"project": [
8471
"**/*.{ts,js,mjs}",
@@ -87,11 +74,8 @@
8774
},
8875
"plugin-packs/postcss-bundler": {
8976
"entry": [
90-
".tape.{cjs,mjs}",
9177
"src/index.ts",
92-
"test/_import.mjs",
93-
"test/_require.cjs",
94-
"test/test.mjs"
78+
"test/**/*.{cjs,mjs}"
9579
],
9680
"project": [
9781
"**/*.ts",
@@ -105,12 +89,9 @@
10589
},
10690
"plugin-packs/*": {
10791
"entry": [
108-
".tape.{cjs,mjs}",
10992
"scripts/**/*.mjs",
11093
"src/index.ts",
111-
"test/_import.mjs",
112-
"test/_require.cjs",
113-
"test/test.mjs"
94+
"test/**/*.{cjs,mjs}"
11495
],
11596
"project": [
11697
"**/*.{ts,js,mjs}",

0 commit comments

Comments
 (0)