supertape 9.2.0 → 9.4.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 CHANGED
@@ -1,3 +1,17 @@
1
+ 2023.12.28, v9.4.0
2
+
3
+ feature:
4
+ - 600c6fb supertape: format: add aditional check to call async operators with await
5
+
6
+ 2023.12.28, v9.3.0
7
+
8
+ fix:
9
+ - 3318f1b @supertape/formatter-time: time
10
+
11
+ feature:
12
+ - fac6958 supertape: find-up v7.0.0
13
+ - 93088e0 supertape: formatter: harness: handle case when write after end
14
+
1
15
  2023.12.22, v9.2.0
2
16
 
3
17
  feature:
package/lib/format.js CHANGED
@@ -13,6 +13,9 @@ module.exports.parseAt = (stack, {reason}) => {
13
13
 
14
14
  const line = lines[reason === 'user' ? REASON_USER : REASON_EXCEPTION];
15
15
 
16
+ if (!line)
17
+ throw Error(`☝️ Looks like 'async' operator called without 'await': ${stack}`);
18
+
16
19
  return line.trim();
17
20
  };
18
21
 
@@ -5,7 +5,6 @@ const {assign} = Object;
5
5
 
6
6
  module.exports.createHarness = (reporter) => {
7
7
  const prepared = prepare(reporter);
8
-
9
8
  const stream = new Transform({
10
9
  readableObjectMode: true,
11
10
  writableObjectMode: true,
@@ -14,11 +13,16 @@ module.exports.createHarness = (reporter) => {
14
13
  const {type, ...data} = chunk;
15
14
  const result = run(prepared, type, data);
16
15
 
16
+ if (this._ended)
17
+ return callback(Error(`☝️ Looks like 'async' operator called without 'await'`));
18
+
17
19
  if (result)
18
20
  this.push(result);
19
21
 
20
- if (type === 'end')
22
+ if (type === 'end') {
23
+ this._ended = true;
21
24
  this.push(null);
25
+ }
22
26
 
23
27
  callback();
24
28
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supertape",
3
- "version": "9.2.0",
3
+ "version": "9.4.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",
@@ -82,7 +82,7 @@
82
82
  "eslint": "^8.0.0",
83
83
  "eslint-plugin-n": "^16.0.1",
84
84
  "eslint-plugin-putout": "^22.0.0",
85
- "find-up": "^6.3.0",
85
+ "find-up": "^7.0.0",
86
86
  "madrun": "^10.0.0",
87
87
  "mock-require": "^3.0.2",
88
88
  "montag": "^1.0.0",