supertape 6.9.1 → 6.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,27 @@
1
+ 2021.10.23, v6.10.0
2
+
3
+ feature:
4
+ - (supertape) checkAssertionsCount: add ability to check that assertions count not less then one
5
+
6
+
7
+ 2021.10.19, v6.9.4
8
+
9
+ fix:
10
+ - (supertape) types: from/to -> result/expected
11
+
12
+
13
+ 2021.10.18, v6.9.3
14
+
15
+ fix:
16
+ - (supertape) types: TestOptions
17
+
18
+
19
+ 2021.10.07, v6.9.2
20
+
21
+ feature:
22
+ - (supertape) add ability to match empty match
23
+
24
+
1
25
  2021.09.25, v6.9.1
2
26
 
3
27
  fix:
package/lib/operators.mjs CHANGED
@@ -34,6 +34,9 @@ const validateRegExp = (regexp) => {
34
34
  if (!isObj(regexp) && !isStr(regexp))
35
35
  return Error('regexp should be RegExp or String');
36
36
 
37
+ if (!regexp)
38
+ return Error('regexp cannot be empty');
39
+
37
40
  return null;
38
41
  };
39
42
 
@@ -13,10 +13,10 @@ type Result = {
13
13
  }
14
14
 
15
15
  type Test = OperatorStub & {
16
- equal: (from: unknown, to: unknown, message?: string) => Result;
17
- notEqual: (from: unknown, to: unknown, message?: string) => Result;
18
- deepEqual: (from: unknown, to: unknown, message?: string) => Result;
19
- notDeepEqual: (from: unknown, to: unknown, message?: string) => Result;
16
+ equal: (result: unknown, expected: unknown, message?: string) => Result;
17
+ notEqual: (result: unknown, expected: unknown, message?: string) => Result;
18
+ deepEqual: (result: unknown, expected: unknown, message?: string) => Result;
19
+ notDeepEqual: (result: unknown, expected: unknown, message?: string) => Result;
20
20
  fail: (message: string) => Result;
21
21
  pass: (message: string) => Result;
22
22
  ok: (result: boolean | unknown, message?: string) => Result;
@@ -27,7 +27,13 @@ type Test = OperatorStub & {
27
27
  end: () => void;
28
28
  }
29
29
 
30
- declare function test(message: string, fn: (t: Test) => void): void;
30
+ type TestOptions = {
31
+ checkAssertionsCount?: boolean,
32
+ checkScopes?: boolean,
33
+ checkDuplicates?: boolean,
34
+ }
35
+
36
+ declare function test(message: string, fn: (t: Test) => void, options?: TestOptions): void;
31
37
  declare namespace test {
32
38
  export var only: typeof test;
33
39
  export var skip: typeof test;
package/lib/validator.js CHANGED
@@ -96,6 +96,9 @@ function checkAssertionsCount(msg, filtered, options) {
96
96
  if (assertionsCount > 1)
97
97
  return [`Only one assertion per test allowed, looks like you have more`, at];
98
98
 
99
+ if (!assertionsCount)
100
+ return [`Only one assertion per test allowed, looks like you have none`, at];
101
+
99
102
  return [];
100
103
  }
101
104
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supertape",
3
- "version": "6.9.1",
3
+ "version": "6.10.0",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
5
  "description": "tape compatible test runner with superpowers",
6
6
  "homepage": "http://github.com/coderaiser/supertape",