supertape 12.0.12 → 12.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ChangeLog CHANGED
@@ -1,3 +1,16 @@
1
+ 2026.01.30, v12.2.0
2
+
3
+ feature:
4
+ - 7a5e1c7 supertape: defineEnv: add
5
+ - 6d023b5 supertape: simplify exports
6
+
7
+ 2026.01.30, v12.1.0
8
+
9
+ feature:
10
+ - f2571a1 supertape: loader: css: add
11
+ - 51beb80 supertape: eslint-plugin-putout v30.0.1
12
+ - 151528e supertape: @putout/eslint-flat v4.0.0
13
+
1
14
  2026.01.11, v12.0.12
2
15
 
3
16
  feature:
package/README.md CHANGED
@@ -17,18 +17,47 @@
17
17
  📼 **Supertape** is a fast, minimal test runner with the soul of **tape**. It's designed to be as compatible as possible with **tape** while still having some key improvements, such as:
18
18
 
19
19
  - the ability to work with [ESM Modules](https://nodejs.org/api/esm.html) (take a look at [mock-import](https://github.com/coderaiser/mock-import) for mocking and 🎩[ESCover](https://github.com/coderaiser/escover) for coverage)
20
+
20
21
  - a number of [built-in pretty output formatters](#formatters)
22
+
21
23
  - the ability to [extend](#testextendextensions)
24
+
22
25
  - showing colored diff when using the [`t.equal()`](#tequalresult-any-expected-any-message-string) and [`t.deepEqual()`](#tdeepequalresult-any-expected-any-message-string) assertion operators
26
+
23
27
  - detailed stack traces for `async` functions
28
+
24
29
  - multiple [`test.only`'s](#testonlyname-cb)
30
+
25
31
  - [smart timeouts](#environment-variables) for long running tests 🏃‍♂️
32
+
26
33
  - more natural assertions: `expected, result` -> `result, expected`:
27
34
 
28
35
  ```js
29
36
  t.equal(error.message, 'hello world', `expected error.message to be 'hello world'`);
30
37
  ```
31
38
 
39
+ - ability to test files that imports css with:
40
+
41
+ ```sh
42
+ NODE_OPTIONS="--import supertape/css" tape '{bin,lib}/**/*.spec.*'
43
+ ```
44
+
45
+ Or in 🏎️[`madrun`](https://github.com/coderaiser/madrun):
46
+
47
+ ```js
48
+ import {run, defineEnv} from 'supertape/env';
49
+
50
+ const testEnv = defineEnv({
51
+ timeout: 7000,
52
+ css: true,
53
+ });
54
+
55
+ export default {
56
+ test: () => [testEnv, `tape 'lib/**/*.spec.js'`],
57
+ coverage: async () => [testEnv, `c8 ${await run('test')}`],
58
+ };
59
+ ```
60
+
32
61
  📼 **Supertape** doesn't contain:
33
62
 
34
63
  - assertion aliases, making the available operators far more concise
@@ -0,0 +1,25 @@
1
+ import process from 'node:process';
2
+
3
+ const {entries} = Object;
4
+ const addLoader = (a) => {
5
+ return `"${a} --import supertape/css"`;
6
+ };
7
+
8
+ export const defineEnv = (config, overrides = {}) => {
9
+ const {env = process.env} = overrides;
10
+ const {NODE_OPTIONS = ''} = env;
11
+ const result = {};
12
+
13
+ for (const [key, value] of entries(config)) {
14
+ if (key === 'css' && value) {
15
+ result.NODE_OPTIONS = addLoader(NODE_OPTIONS);
16
+ continue;
17
+ }
18
+
19
+ const name = `SUPERTAPE_${key.toUpperCase()}`;
20
+
21
+ result[name] = value;
22
+ }
23
+
24
+ return result;
25
+ };
@@ -0,0 +1,20 @@
1
+ export function resolve(specifier, context, nextResolve) {
2
+ if (specifier.endsWith('.css'))
3
+ return {
4
+ url: new URL(specifier, context.parentURL).href,
5
+ shortCircuit: true,
6
+ };
7
+
8
+ return nextResolve(specifier, context);
9
+ }
10
+
11
+ export function load(url, context, nextLoad) {
12
+ if (url.endsWith('.css'))
13
+ return {
14
+ format: 'module',
15
+ source: 'export default {};',
16
+ shortCircuit: true,
17
+ };
18
+
19
+ return nextLoad(url, context);
20
+ }
@@ -0,0 +1,5 @@
1
+ import {register} from 'node:module';
2
+
3
+ const loaderUrl = new URL('./css.js', import.meta.url);
4
+
5
+ register(loaderUrl);
package/package.json CHANGED
@@ -1,22 +1,18 @@
1
1
  {
2
2
  "name": "supertape",
3
- "version": "12.0.12",
3
+ "version": "12.2.0",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
5
  "description": "📼 Supertape simplest high speed test runner with superpowers",
6
6
  "homepage": "http://github.com/coderaiser/supertape",
7
7
  "type": "module",
8
8
  "main": "./lib/supertape.js",
9
9
  "exports": {
10
- ".": {
11
- "node": {
12
- "require": "./lib/supertape.cjs",
13
- "import": "./lib/supertape.js"
14
- },
15
- "default": "./lib/supertape.js"
16
- },
10
+ ".": "./lib/supertape.js",
17
11
  "./bin/supertape": "./bin/supertape.js",
18
12
  "./cli": "./lib/cli.js",
19
- "./exit-codes": "./lib/exit-codes.js"
13
+ "./exit-codes": "./lib/exit-codes.js",
14
+ "./css": "./lib/loader/register.js",
15
+ "./env": "./lib/env/index.js"
20
16
  },
21
17
  "bin": {
22
18
  "tape": "bin/tracer.js",
@@ -53,7 +49,7 @@
53
49
  "cli-progress": "^3.8.2",
54
50
  "flatted": "^3.3.1",
55
51
  "fullstore": "^4.0.0",
56
- "glob": "^11.0.1",
52
+ "glob": "^13.0.0",
57
53
  "jest-diff": "^30.0.3",
58
54
  "json-with-bigint": "^3.4.4",
59
55
  "once": "^1.4.0",
@@ -75,12 +71,12 @@
75
71
  ],
76
72
  "devDependencies": {
77
73
  "@iocmd/wait": "^2.1.0",
78
- "@putout/eslint-flat": "^3.0.0",
74
+ "@putout/eslint-flat": "^4.0.0",
79
75
  "c8": "^10.1.2",
80
76
  "check-dts": "^0.9.0",
81
77
  "currify": "^4.0.0",
82
78
  "eslint": "^9.1.1",
83
- "eslint-plugin-putout": "^29.0.2",
79
+ "eslint-plugin-putout": "^30.0.1",
84
80
  "find-up": "^8.0.0",
85
81
  "madrun": "^12.1.0",
86
82
  "montag": "^1.0.0",
package/lib/supertape.cjs DELETED
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- const {test} = require('./supertape.js');
4
-
5
- module.exports = test;