@mediatool/frontend-tools 1.0.2 → 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 +4 -1
- package/lib/cli.js +1 -0
- package/lib/test/index.js +3 -1
- package/package.json +1 -1
package/dist/mtft.cjs
CHANGED
|
@@ -77,11 +77,13 @@ const types = {
|
|
|
77
77
|
it: `./{,!(node_modules)/**}/test/it/*-test.${extensions}`,
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
-
async function test (typeOrSpec) {
|
|
80
|
+
async function test (typeOrSpec, options) {
|
|
81
|
+
const { require = [] } = options;
|
|
81
82
|
const spec = types[typeOrSpec] || typeOrSpec;
|
|
82
83
|
|
|
83
84
|
const plugins = await runHelpers_js.handleRequires([
|
|
84
85
|
'@mediatool/frontend-tools/lib/test/setup-mocha.cjs',
|
|
86
|
+
...require,
|
|
85
87
|
]);
|
|
86
88
|
const opts = {
|
|
87
89
|
spec: [ spec ],
|
|
@@ -106,6 +108,7 @@ program.command('build')
|
|
|
106
108
|
program.command('test')
|
|
107
109
|
.description('not sure ey? run the tests then')
|
|
108
110
|
.argument('[type]', 'unit (unit tests),it (integration tests)', 'all')
|
|
111
|
+
.option('-r, --require <paths...>', 'custom mocha requires')
|
|
109
112
|
.action(test);
|
|
110
113
|
|
|
111
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 ],
|