supertape 8.8.0 → 8.10.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,13 @@
1
+ 2023.12.08, v8.10.0
2
+
3
+ feature:
4
+ - 02028a6 supertape: SUPERTAPE_LOAD_LOOP_TIMEOUT: add
5
+
6
+ 2023.12.04, v8.9.0
7
+
8
+ feature:
9
+ - 549609b supertape: match: improve convert to RegExp
10
+
1
11
  2023.12.01, v8.8.0
2
12
 
3
13
  feature:
package/README.md CHANGED
@@ -32,9 +32,9 @@
32
32
  📼 **Supertape** doesn't contain:
33
33
 
34
34
  - assertion aliases, making the available operators far more concise
35
- - `es3 code` and lot's of [ponyfills](https://github.com/sindresorhus/ponyfill#how-are-ponyfills-better-than-polyfills)
36
- - `t.throws()`, `t.doesNotThrow()` - use [**tryCatch**](https://github.com/coderaiser/try-catch) or [**tryToCatch**](https://github.com/coderaiser/try-to-catch) with [`t.equal()`](#tequalresult-any-expected-any-message-string) instead
37
- - [`t.plan()`](https://github.com/substack/tape#tplann)
35
+ - `es3 code` and lot's of [ponyfills](https://github.com/sindresorhus/ponyfill#how-are-ponyfills-better-than-polyfills);
36
+ - `t.throws()`, `t.doesNotThrow()` - use [**tryCatch**](https://github.com/coderaiser/try-catch) or [**tryToCatch**](https://github.com/coderaiser/try-to-catch) with [`t.equal()`](#tequalresult-any-expected-any-message-string) instead;
37
+ - [`t.plan()`](https://github.com/substack/tape#tplann);
38
38
 
39
39
  For a list of all built-in assertions, see [Operators](#operators).
40
40
 
@@ -64,7 +64,8 @@ Options
64
64
  - `SUPERTAPE_CHECK_DUPLICATES` - toggle check duplicates;
65
65
  - `SUPERTAPE_CHECK_SCOPES` - check that test message has a scope: `scope: subject`;
66
66
  - `SUPERTAPE_CHECK_ASSERTIONS_COUNT` - check that assertion count is no more then 1;
67
- - `SUPERTAPE_CHECK_SKIPED` - check that skiped count equal to `0`, exit with status code
67
+ - `SUPERTAPE_CHECK_SKIPED` - check that skiped count equal to `0`, exit with status code;
68
+ - `SUPERTAPE_LOAD_LOOP_TIMEOUT` - timeout for load tests, defaults to `5ms`, when mocha used as runner - `50ms` optimal;
68
69
 
69
70
  ```js
70
71
  test('tape: error', (t) => {
package/lib/operators.mjs CHANGED
@@ -7,7 +7,14 @@ import {
7
7
 
8
8
  const {entries} = Object;
9
9
  const isAsync = (a) => a[Symbol.toStringTag] === 'AsyncFunction';
10
- const maybeRegExp = (a) => isStr(a) ? RegExp(a) : a;
10
+ const encode = (a) => a.replace(')', '\\)').replace('(', '\\(');
11
+
12
+ const maybeRegExp = (a) => {
13
+ if (!isStr(a))
14
+ return a;
15
+
16
+ return RegExp(encode(a));
17
+ };
11
18
 
12
19
  const isFn = (a) => typeof a === 'function';
13
20
  const isStr = (a) => typeof a === 'string';
package/lib/supertape.js CHANGED
@@ -18,6 +18,9 @@ const createEmitter = once(_createEmitter);
18
18
  const {assign} = Object;
19
19
  const {stdout} = process;
20
20
 
21
+ // 5ms ought to be enough for anybody
22
+ const {SUPERTAPE_LOAD_LOOP_TIMEOUT = 5} = process.env;
23
+
21
24
  let mainEmitter;
22
25
 
23
26
  const getOperators = once(async () => {
@@ -239,8 +242,7 @@ const loop = once(({emitter, tests}) => {
239
242
  }
240
243
 
241
244
  previousCount = tests.length;
242
- // 5ms ought to be enough for anybody
243
- setTimeout(loop, 5);
245
+ setTimeout(loop, SUPERTAPE_LOAD_LOOP_TIMEOUT);
244
246
  })();
245
247
  });
246
248
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supertape",
3
- "version": "8.8.0",
3
+ "version": "8.10.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",