@mediatool/frontend-tools 1.0.1 → 1.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/dist/mtft.cjs +5 -1
- package/lib/cli.js +1 -0
- package/lib/test/index.js +3 -1
- package/package.json +1 -1
- package/rollup.config.js +1 -0
package/dist/mtft.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var commander = require('commander');
|
|
@@ -76,11 +77,13 @@ const types = {
|
|
|
76
77
|
it: `./{,!(node_modules)/**}/test/it/*-test.${extensions}`,
|
|
77
78
|
};
|
|
78
79
|
|
|
79
|
-
async function test (typeOrSpec) {
|
|
80
|
+
async function test (typeOrSpec, options) {
|
|
81
|
+
const { require = [] } = options;
|
|
80
82
|
const spec = types[typeOrSpec] || typeOrSpec;
|
|
81
83
|
|
|
82
84
|
const plugins = await runHelpers_js.handleRequires([
|
|
83
85
|
'@mediatool/frontend-tools/lib/test/setup-mocha.cjs',
|
|
86
|
+
...require,
|
|
84
87
|
]);
|
|
85
88
|
const opts = {
|
|
86
89
|
spec: [ spec ],
|
|
@@ -105,6 +108,7 @@ program.command('build')
|
|
|
105
108
|
program.command('test')
|
|
106
109
|
.description('not sure ey? run the tests then')
|
|
107
110
|
.argument('[type]', 'unit (unit tests),it (integration tests)', 'all')
|
|
111
|
+
.option('-r, --require <paths...>', 'custom mocha requires')
|
|
108
112
|
.action(test);
|
|
109
113
|
|
|
110
114
|
program.parse();
|
package/lib/cli.js
CHANGED
|
@@ -18,6 +18,7 @@ program.command('build')
|
|
|
18
18
|
program.command('test')
|
|
19
19
|
.description('not sure ey? run the tests then')
|
|
20
20
|
.argument('[type]', 'unit (unit tests),it (integration tests)', 'all')
|
|
21
|
+
.option('-r, --require <paths...>', 'custom mocha requires')
|
|
21
22
|
.action(test)
|
|
22
23
|
|
|
23
24
|
program.parse()
|
package/lib/test/index.js
CHANGED
|
@@ -8,11 +8,13 @@ const types = {
|
|
|
8
8
|
it: `./{,!(node_modules)/**}/test/it/*-test.${extensions}`,
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export default async function test (typeOrSpec) {
|
|
11
|
+
export default async function test (typeOrSpec, options) {
|
|
12
|
+
const { require = [] } = options
|
|
12
13
|
const spec = types[typeOrSpec] || typeOrSpec
|
|
13
14
|
|
|
14
15
|
const plugins = await handleRequires([
|
|
15
16
|
'@mediatool/frontend-tools/lib/test/setup-mocha.cjs',
|
|
17
|
+
...require,
|
|
16
18
|
])
|
|
17
19
|
const opts = {
|
|
18
20
|
spec: [ spec ],
|
package/package.json
CHANGED