supertape 12.0.5 → 12.0.7
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 +11 -0
- package/lib/cli/parse-args.js +1 -0
- package/lib/cli.js +6 -6
- package/lib/supertape.js +22 -22
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/lib/cli/parse-args.js
CHANGED
package/lib/cli.js
CHANGED
|
@@ -159,10 +159,6 @@ async function _cli(overrides) {
|
|
|
159
159
|
workerFormatter,
|
|
160
160
|
});
|
|
161
161
|
|
|
162
|
-
const stream = await supertape.createStream();
|
|
163
|
-
|
|
164
|
-
stream.pipe(stdout);
|
|
165
|
-
|
|
166
162
|
const files = removeDuplicates(allFiles);
|
|
167
163
|
|
|
168
164
|
filesCount(files.length);
|
|
@@ -170,6 +166,9 @@ async function _cli(overrides) {
|
|
|
170
166
|
if (!files.length)
|
|
171
167
|
return OK;
|
|
172
168
|
|
|
169
|
+
const stream = await supertape.createStream();
|
|
170
|
+
stream.pipe(stdout);
|
|
171
|
+
|
|
173
172
|
const resolvedNames = [];
|
|
174
173
|
|
|
175
174
|
// always resolve before import for windows
|
|
@@ -177,8 +176,9 @@ async function _cli(overrides) {
|
|
|
177
176
|
resolvedNames.push(pathToFileURL(resolvePath(cwd, file)));
|
|
178
177
|
}
|
|
179
178
|
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
if (!args.dryRun)
|
|
180
|
+
for (const resolved of resolvedNames)
|
|
181
|
+
await import(resolved);
|
|
182
182
|
|
|
183
183
|
const [result] = await once(supertape.run(), 'end');
|
|
184
184
|
|
package/lib/supertape.js
CHANGED
|
@@ -8,13 +8,26 @@ const stub = require('@cloudcmd/stub');
|
|
|
8
8
|
|
|
9
9
|
const once = require('once');
|
|
10
10
|
const {maybeOnce} = require('./maybe-once');
|
|
11
|
-
|
|
12
11
|
const options = require('../supertape.json');
|
|
13
|
-
|
|
14
12
|
const {getAt, setValidations} = require('./validator');
|
|
15
13
|
|
|
16
14
|
const {createEmitter: _createEmitter} = require('./emitter.mjs');
|
|
15
|
+
|
|
17
16
|
const _createFormatter = require('./formatter').createFormatter;
|
|
17
|
+
const createOnly = (test) => (message, fn, options) => {
|
|
18
|
+
return test(message, fn, {
|
|
19
|
+
...options,
|
|
20
|
+
only: true,
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const createSkip = (test) => (message, fn, options) => {
|
|
25
|
+
return test(message, fn, {
|
|
26
|
+
...options,
|
|
27
|
+
skip: true,
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
18
31
|
const {env} = process;
|
|
19
32
|
const {assign} = Object;
|
|
20
33
|
const createEmitter = once(_createEmitter);
|
|
@@ -115,6 +128,8 @@ module.exports.createTest = async (testOptions = {}) => {
|
|
|
115
128
|
...test,
|
|
116
129
|
extend: createExtend(fn),
|
|
117
130
|
test: fn,
|
|
131
|
+
only: createOnly(fn),
|
|
132
|
+
skip: createSkip(fn),
|
|
118
133
|
run: () => {
|
|
119
134
|
emitter.emit('run');
|
|
120
135
|
},
|
|
@@ -187,19 +202,8 @@ function test(message, fn, options = {}, overrides = {}) {
|
|
|
187
202
|
return emitter;
|
|
188
203
|
}
|
|
189
204
|
|
|
190
|
-
test.skip = (
|
|
191
|
-
|
|
192
|
-
...options,
|
|
193
|
-
skip: true,
|
|
194
|
-
});
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
test.only = (message, fn, options) => {
|
|
198
|
-
return test(message, fn, {
|
|
199
|
-
...options,
|
|
200
|
-
only: true,
|
|
201
|
-
});
|
|
202
|
-
};
|
|
205
|
+
test.skip = createSkip(test);
|
|
206
|
+
test.only = createOnly(test);
|
|
203
207
|
|
|
204
208
|
const getExtend = (test, extensions, type) => (message, fn, options) => {
|
|
205
209
|
return test(message, fn, {
|
|
@@ -234,18 +238,15 @@ const loop = maybeOnce(({emitter, tests}) => {
|
|
|
234
238
|
})();
|
|
235
239
|
});
|
|
236
240
|
|
|
237
|
-
module.exports.run = () => {
|
|
238
|
-
|
|
239
|
-
if (!mainEmitter)
|
|
241
|
+
module.exports.run = ({fake} = {}) => {
|
|
242
|
+
if (!mainEmitter || fake)
|
|
240
243
|
return fakeEmitter();
|
|
241
244
|
|
|
242
|
-
/* c8 ignore end */
|
|
243
245
|
mainEmitter.emit('loop');
|
|
244
246
|
|
|
245
247
|
return mainEmitter;
|
|
246
248
|
};
|
|
247
249
|
|
|
248
|
-
/* c8 ignore start */
|
|
249
250
|
function fakeEmitter() {
|
|
250
251
|
const emitter = new EventEmitter();
|
|
251
252
|
|
|
@@ -256,5 +257,4 @@ function fakeEmitter() {
|
|
|
256
257
|
});
|
|
257
258
|
|
|
258
259
|
return emitter;
|
|
259
|
-
}
|
|
260
|
-
|
|
260
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supertape",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.7",
|
|
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",
|