@vanillaes/esmtk 0.20.1 → 0.22.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/.vscode/launch.json +24 -0
- package/README.md +8 -0
- package/bin/commands/test.js +8 -0
- package/bin/esmtk.js +3 -1
- package/package.json +1 -1
package/.vscode/launch.json
CHANGED
|
@@ -37,6 +37,30 @@
|
|
|
37
37
|
"args": ["test"],
|
|
38
38
|
"console": "integratedTerminal",
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
"name": "Test --ignore",
|
|
42
|
+
"type": "node",
|
|
43
|
+
"request": "launch",
|
|
44
|
+
"skipFiles": [
|
|
45
|
+
"<node_internals>/**"
|
|
46
|
+
],
|
|
47
|
+
"program": "${workspaceFolder}/bin/esmtk.js",
|
|
48
|
+
"cwd": "${workspaceFolder}",
|
|
49
|
+
"args": ["test", "--ignore", "node_modules/**,src/util.spec.js"],
|
|
50
|
+
"console": "integratedTerminal",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "Test --root",
|
|
54
|
+
"type": "node",
|
|
55
|
+
"request": "launch",
|
|
56
|
+
"skipFiles": [
|
|
57
|
+
"<node_internals>/**"
|
|
58
|
+
],
|
|
59
|
+
"program": "${workspaceFolder}/bin/esmtk.js",
|
|
60
|
+
"cwd": "${workspaceFolder}",
|
|
61
|
+
"args": ["test", "--root", "src/"],
|
|
62
|
+
"console": "integratedTerminal",
|
|
63
|
+
},
|
|
40
64
|
{
|
|
41
65
|
"name": "Lint",
|
|
42
66
|
"type": "node",
|
package/README.md
CHANGED
|
@@ -50,6 +50,8 @@ Run tests (using Tape-ES)
|
|
|
50
50
|
`esmtk test [glob]`
|
|
51
51
|
|
|
52
52
|
- `[glob]` - the glob used to locate test files (default: `**/*.spec.js`)
|
|
53
|
+
- `-i` | `--ignore` - the ignore matcher pattern (default `**/node_modules/**`)
|
|
54
|
+
- `-r` | `--root` - the root path to run the tests from (default `process.cwd()`)
|
|
53
55
|
- `--watch` - watch for changes to the tests
|
|
54
56
|
|
|
55
57
|
### Usage
|
|
@@ -61,6 +63,12 @@ npx @vanillaes/esmtk test
|
|
|
61
63
|
# run the tests (using a different naming scheme)
|
|
62
64
|
npx @vanillaes/esmtk test **/*.test.js
|
|
63
65
|
|
|
66
|
+
# run the tests (ignore tests)
|
|
67
|
+
npx @vanillaes/esmtk test **/*.test.js --ignore **/node_modules/**,src/rm.spec.js
|
|
68
|
+
|
|
69
|
+
# run the tests (ignore tests)
|
|
70
|
+
npx @vanillaes/esmtk test **/*.test.js --root src/
|
|
71
|
+
|
|
64
72
|
# run the tests (watch for changes)
|
|
65
73
|
npx @vanillaes/esmtk test --watch
|
|
66
74
|
```
|
package/bin/commands/test.js
CHANGED
|
@@ -9,6 +9,14 @@ export async function test (glob, options) {
|
|
|
9
9
|
const args = []
|
|
10
10
|
args.push('./node_modules/.bin/tape-es')
|
|
11
11
|
args.push(glob)
|
|
12
|
+
if (options?.ignore) {
|
|
13
|
+
args.push('--ignore')
|
|
14
|
+
args.push(options.ignore)
|
|
15
|
+
}
|
|
16
|
+
if (options?.root) {
|
|
17
|
+
args.push('--root')
|
|
18
|
+
args.push(options.root)
|
|
19
|
+
}
|
|
12
20
|
if (options?.watch) {
|
|
13
21
|
args.push('--watch')
|
|
14
22
|
}
|
package/bin/esmtk.js
CHANGED
|
@@ -16,7 +16,9 @@ program.command('init')
|
|
|
16
16
|
|
|
17
17
|
program.command('test')
|
|
18
18
|
.description('Run tests using Tape-ES')
|
|
19
|
-
.argument('[glob]', 'The glob pattern used to find test files', '**/*.spec.js')
|
|
19
|
+
.argument('[glob]', 'The glob pattern used to find test files (default: `**/*.spec.js`)', '**/*.spec.js')
|
|
20
|
+
.option('-i, --ignore <ignore>', 'the ignore matcher pattern (default `**/node_modules/**`)')
|
|
21
|
+
.option('-r, --root <root>', 'the root path to run the tests from (default `process.cwd()`)')
|
|
20
22
|
.option('--watch', 'Watch the files for changes')
|
|
21
23
|
.action((glob, options) => {
|
|
22
24
|
test(glob, options)
|