supertape 13.0.0 → 13.1.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 +7 -0
- package/README.md +1 -1
- package/lib/env/index.js +13 -4
- package/package.json +1 -3
package/ChangeLog
CHANGED
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
- ability to test files that imports css with:
|
|
42
42
|
|
|
43
43
|
```sh
|
|
44
|
-
NODE_OPTIONS="--import supertape/css" tape '{bin,lib}/**/*.spec.*'
|
|
44
|
+
NODE_OPTIONS="--import @supertape/loader-css" tape '{bin,lib}/**/*.spec.*'
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
Or in 🏎️[`madrun`](https://github.com/coderaiser/madrun):
|
package/lib/env/index.js
CHANGED
|
@@ -4,8 +4,7 @@ import justSnakeCase from 'just-snake-case';
|
|
|
4
4
|
const isBool = (a) => typeof a === 'boolean';
|
|
5
5
|
const {entries} = Object;
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
const addJSXLoader = (a) => `"${a} --import @supertape/loader-jsx"`;
|
|
7
|
+
const addLoader = (a) => `--import @supertape/loader-${a}`;
|
|
9
8
|
|
|
10
9
|
const parseValue = (a) => {
|
|
11
10
|
if (isBool(a))
|
|
@@ -18,15 +17,23 @@ export const defineEnv = (config, overrides = {}) => {
|
|
|
18
17
|
const {env = process.env} = overrides;
|
|
19
18
|
const {NODE_OPTIONS = ''} = env;
|
|
20
19
|
const result = {};
|
|
20
|
+
let localEnv = NODE_OPTIONS;
|
|
21
21
|
|
|
22
22
|
for (const [key, value] of entries(config)) {
|
|
23
23
|
if (key === 'css' && value) {
|
|
24
|
-
|
|
24
|
+
localEnv += ` ${addLoader('css')}`;
|
|
25
25
|
continue;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
if (key === 'jsx' && value) {
|
|
29
|
-
|
|
29
|
+
localEnv += ` ${addLoader('jsx')}`;
|
|
30
|
+
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (key === 'dom' && value) {
|
|
35
|
+
localEnv += ` ${addLoader('dom')}`;
|
|
36
|
+
|
|
30
37
|
continue;
|
|
31
38
|
}
|
|
32
39
|
|
|
@@ -35,5 +42,7 @@ export const defineEnv = (config, overrides = {}) => {
|
|
|
35
42
|
result[name] = parseValue(value);
|
|
36
43
|
}
|
|
37
44
|
|
|
45
|
+
result.NODE_OPTIONS = `"${localEnv}"`;
|
|
46
|
+
|
|
38
47
|
return result;
|
|
39
48
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supertape",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.1.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",
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
"./bin/supertape": "./bin/tracer.js",
|
|
12
12
|
"./cli": "./lib/cli.js",
|
|
13
13
|
"./exit-codes": "./lib/exit-codes.js",
|
|
14
|
-
"./css": "./lib/loader/register-css.js",
|
|
15
|
-
"./jsx": "./lib/loader/register-jsx.js",
|
|
16
14
|
"./env": "./lib/env/index.js"
|
|
17
15
|
},
|
|
18
16
|
"imports": {
|