xunit.ts 1.4.0 → 3.0.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/README.md +44 -19
- package/cli.ts +9 -4
- package/dist/cli.js +4 -4
- package/dist/cli.js.map +1 -1
- package/dist/eslint.config.d.ts +3 -0
- package/dist/eslint.config.d.ts.map +1 -0
- package/dist/eslint.config.js +46 -0
- package/dist/eslint.config.js.map +1 -0
- package/dist/src/Assertions/Contains.d.ts +1 -1
- package/dist/src/Assertions/Contains.d.ts.map +1 -1
- package/dist/src/Assertions/Contains.js +4 -4
- package/dist/src/Assertions/Contains.js.map +1 -1
- package/dist/src/Assertions/Count.d.ts +1 -1
- package/dist/src/Assertions/Count.d.ts.map +1 -1
- package/dist/src/Assertions/Count.js +4 -4
- package/dist/src/Assertions/Count.js.map +1 -1
- package/dist/src/Assertions/Defined.d.ts +1 -1
- package/dist/src/Assertions/Defined.d.ts.map +1 -1
- package/dist/src/Assertions/Defined.js +4 -4
- package/dist/src/Assertions/Defined.js.map +1 -1
- package/dist/src/Assertions/DoesNotContain.d.ts +1 -1
- package/dist/src/Assertions/DoesNotContain.d.ts.map +1 -1
- package/dist/src/Assertions/DoesNotContain.js +4 -4
- package/dist/src/Assertions/DoesNotContain.js.map +1 -1
- package/dist/src/Assertions/DoesNotThrow.d.ts +1 -1
- package/dist/src/Assertions/DoesNotThrow.d.ts.map +1 -1
- package/dist/src/Assertions/DoesNotThrow.js +4 -4
- package/dist/src/Assertions/DoesNotThrow.js.map +1 -1
- package/dist/src/Assertions/Empty.d.ts +1 -1
- package/dist/src/Assertions/Empty.d.ts.map +1 -1
- package/dist/src/Assertions/Empty.js +4 -4
- package/dist/src/Assertions/Empty.js.map +1 -1
- package/dist/src/Assertions/Equal.d.ts +1 -1
- package/dist/src/Assertions/Equal.d.ts.map +1 -1
- package/dist/src/Assertions/Equal.js +4 -4
- package/dist/src/Assertions/Equal.js.map +1 -1
- package/dist/src/Assertions/False.d.ts +1 -1
- package/dist/src/Assertions/False.d.ts.map +1 -1
- package/dist/src/Assertions/False.js +4 -4
- package/dist/src/Assertions/False.js.map +1 -1
- package/dist/src/Assertions/InstanceOf.d.ts +1 -1
- package/dist/src/Assertions/InstanceOf.d.ts.map +1 -1
- package/dist/src/Assertions/InstanceOf.js +4 -4
- package/dist/src/Assertions/InstanceOf.js.map +1 -1
- package/dist/src/Assertions/NotEmpty.d.ts +1 -1
- package/dist/src/Assertions/NotEmpty.d.ts.map +1 -1
- package/dist/src/Assertions/NotEmpty.js +4 -4
- package/dist/src/Assertions/NotEmpty.js.map +1 -1
- package/dist/src/Assertions/NotEqual.d.ts +1 -1
- package/dist/src/Assertions/NotEqual.d.ts.map +1 -1
- package/dist/src/Assertions/NotEqual.js +4 -4
- package/dist/src/Assertions/NotEqual.js.map +1 -1
- package/dist/src/Assertions/NotNull.d.ts +1 -1
- package/dist/src/Assertions/NotNull.d.ts.map +1 -1
- package/dist/src/Assertions/NotNull.js +4 -4
- package/dist/src/Assertions/NotNull.js.map +1 -1
- package/dist/src/Assertions/Null.d.ts +1 -1
- package/dist/src/Assertions/Null.d.ts.map +1 -1
- package/dist/src/Assertions/Null.js +4 -4
- package/dist/src/Assertions/Null.js.map +1 -1
- package/dist/src/Assertions/StringContains.js +5 -5
- package/dist/src/Assertions/StringContains.js.map +1 -1
- package/dist/src/Assertions/StringDoesNotContain.js +5 -5
- package/dist/src/Assertions/StringDoesNotContain.js.map +1 -1
- package/dist/src/Assertions/StringDoesNotEndWith.d.ts.map +1 -1
- package/dist/src/Assertions/StringDoesNotEndWith.js +5 -7
- package/dist/src/Assertions/StringDoesNotEndWith.js.map +1 -1
- package/dist/src/Assertions/StringDoesNotMatch.d.ts +17 -0
- package/dist/src/Assertions/StringDoesNotMatch.d.ts.map +1 -0
- package/dist/src/Assertions/StringDoesNotMatch.js +30 -0
- package/dist/src/Assertions/StringDoesNotMatch.js.map +1 -0
- package/dist/src/Assertions/StringDoesNotStartWith.js +5 -5
- package/dist/src/Assertions/StringDoesNotStartWith.js.map +1 -1
- package/dist/src/Assertions/StringEndsWith.d.ts.map +1 -1
- package/dist/src/Assertions/StringEndsWith.js +5 -7
- package/dist/src/Assertions/StringEndsWith.js.map +1 -1
- package/dist/src/Assertions/StringMatches.d.ts +17 -0
- package/dist/src/Assertions/StringMatches.d.ts.map +1 -0
- package/dist/src/Assertions/StringMatches.js +30 -0
- package/dist/src/Assertions/StringMatches.js.map +1 -0
- package/dist/src/Assertions/StringStartsWith.js +5 -5
- package/dist/src/Assertions/StringStartsWith.js.map +1 -1
- package/dist/src/Assertions/Throws.d.ts +1 -1
- package/dist/src/Assertions/Throws.d.ts.map +1 -1
- package/dist/src/Assertions/Throws.js +5 -5
- package/dist/src/Assertions/Throws.js.map +1 -1
- package/dist/src/Assertions/True.d.ts +1 -1
- package/dist/src/Assertions/True.d.ts.map +1 -1
- package/dist/src/Assertions/True.js +4 -4
- package/dist/src/Assertions/True.js.map +1 -1
- package/dist/src/Assertions/Undefined.d.ts +1 -1
- package/dist/src/Assertions/Undefined.d.ts.map +1 -1
- package/dist/src/Assertions/Undefined.js +4 -4
- package/dist/src/Assertions/Undefined.js.map +1 -1
- package/dist/src/Assertions/index.d.ts +18 -14
- package/dist/src/Assertions/index.d.ts.map +1 -1
- package/dist/src/Assertions/index.js +18 -14
- package/dist/src/Assertions/index.js.map +1 -1
- package/dist/src/CLI.d.ts +1 -3
- package/dist/src/CLI.d.ts.map +1 -1
- package/dist/src/CLI.js +9 -7
- package/dist/src/CLI.js.map +1 -1
- package/dist/src/Factory.d.ts +1 -1
- package/dist/src/Factory.d.ts.map +1 -1
- package/dist/src/Factory.js +7 -7
- package/dist/src/Factory.js.map +1 -1
- package/dist/src/Framework/ResultType.js +1 -1
- package/dist/src/Framework/ResultType.js.map +1 -1
- package/dist/src/Framework/Test.d.ts +1 -1
- package/dist/src/Framework/Test.d.ts.map +1 -1
- package/dist/src/Framework/Test.js +2 -2
- package/dist/src/Framework/Test.js.map +1 -1
- package/dist/src/Framework/TestInfo.d.ts +5 -1
- package/dist/src/Framework/TestInfo.d.ts.map +1 -1
- package/dist/src/Framework/TestName.js +2 -2
- package/dist/src/Framework/TestName.js.map +1 -1
- package/dist/src/Framework/TestSuite.d.ts +4 -2
- package/dist/src/Framework/TestSuite.d.ts.map +1 -1
- package/dist/src/Framework/TestSuite.js +8 -5
- package/dist/src/Framework/TestSuite.js.map +1 -1
- package/dist/src/IO/FileSystem.d.ts +2 -2
- package/dist/src/IO/FileSystem.d.ts.map +1 -1
- package/dist/src/IO/FileSystem.js +6 -5
- package/dist/src/IO/FileSystem.js.map +1 -1
- package/dist/src/IO/Output.d.ts +1 -2
- package/dist/src/IO/Output.d.ts.map +1 -1
- package/dist/src/IO/Output.js.map +1 -1
- package/dist/src/Reporters/ConsoleReporter.d.ts +4 -5
- package/dist/src/Reporters/ConsoleReporter.d.ts.map +1 -1
- package/dist/src/Reporters/ConsoleReporter.js +39 -28
- package/dist/src/Reporters/ConsoleReporter.js.map +1 -1
- package/dist/src/Reporters/FileReporter.d.ts +4 -5
- package/dist/src/Reporters/FileReporter.d.ts.map +1 -1
- package/dist/src/Reporters/FileReporter.js +0 -1
- package/dist/src/Reporters/FileReporter.js.map +1 -1
- package/dist/src/Reporters/JUnitReporter.d.ts.map +1 -1
- package/dist/src/Reporters/JUnitReporter.js +1 -1
- package/dist/src/Reporters/JUnitReporter.js.map +1 -1
- package/dist/src/Reporters/ResultReporter.d.ts +2 -3
- package/dist/src/Reporters/ResultReporter.d.ts.map +1 -1
- package/dist/src/Reporters/ResultReporter.js +1 -0
- package/dist/src/Reporters/ResultReporter.js.map +1 -1
- package/dist/src/Reporters/SonarReporter.d.ts.map +1 -1
- package/dist/src/Reporters/SonarReporter.js +2 -2
- package/dist/src/Reporters/SonarReporter.js.map +1 -1
- package/dist/src/Reporters/XMLReporter.d.ts +1 -1
- package/dist/src/Reporters/XMLReporter.d.ts.map +1 -1
- package/dist/src/Reporters/XMLReporter.js.map +1 -1
- package/dist/src/Runners/Runner.d.ts +3 -3
- package/dist/src/Runners/Runner.d.ts.map +1 -1
- package/dist/src/Runners/Runner.js +1 -1
- package/dist/src/Runners/Runner.js.map +1 -1
- package/dist/src/Runners/TestRunner.d.ts +4 -2
- package/dist/src/Runners/TestRunner.d.ts.map +1 -1
- package/dist/src/Runners/TestRunner.js +13 -8
- package/dist/src/Runners/TestRunner.js.map +1 -1
- package/dist/src/Runners/TestSuiteLoader.d.ts.map +1 -1
- package/dist/src/Runners/TestSuiteLoader.js +32 -18
- package/dist/src/Runners/TestSuiteLoader.js.map +1 -1
- package/dist/src/Runners/TestSuiteRunner.d.ts +4 -4
- package/dist/src/Runners/TestSuiteRunner.d.ts.map +1 -1
- package/dist/src/Runners/TestSuiteRunner.js +3 -3
- package/dist/src/Runners/TestSuiteRunner.js.map +1 -1
- package/dist/xunit.d.ts +2 -2
- package/dist/xunit.d.ts.map +1 -1
- package/dist/xunit.js +3 -3
- package/dist/xunit.js.map +1 -1
- package/eslint.config.ts +44 -0
- package/package.json +18 -14
- package/src/Assertions/Contains.ts +3 -3
- package/src/Assertions/Count.ts +3 -3
- package/src/Assertions/Defined.ts +3 -3
- package/src/Assertions/DoesNotContain.ts +3 -3
- package/src/Assertions/DoesNotThrow.ts +3 -3
- package/src/Assertions/Empty.ts +3 -3
- package/src/Assertions/Equal.ts +4 -3
- package/src/Assertions/False.ts +3 -3
- package/src/Assertions/InstanceOf.ts +3 -3
- package/src/Assertions/NotEmpty.ts +3 -3
- package/src/Assertions/NotEqual.ts +4 -3
- package/src/Assertions/NotNull.ts +3 -3
- package/src/Assertions/Null.ts +3 -3
- package/src/Assertions/StringContains.ts +3 -3
- package/src/Assertions/StringDoesNotContain.ts +3 -3
- package/src/Assertions/StringDoesNotEndWith.ts +3 -5
- package/src/Assertions/StringDoesNotMatch.ts +28 -0
- package/src/Assertions/StringDoesNotStartWith.ts +3 -3
- package/src/Assertions/StringEndsWith.ts +3 -5
- package/src/Assertions/StringMatches.ts +28 -0
- package/src/Assertions/StringStartsWith.ts +3 -3
- package/src/Assertions/Throws.ts +4 -4
- package/src/Assertions/True.ts +3 -3
- package/src/Assertions/Undefined.ts +3 -3
- package/src/Assertions/index.ts +19 -25
- package/src/CLI.ts +11 -7
- package/src/Factory.ts +11 -9
- package/src/Framework/Test.ts +2 -2
- package/src/Framework/TestInfo.ts +7 -1
- package/src/Framework/TestName.ts +2 -2
- package/src/Framework/TestSuite.ts +12 -7
- package/src/IO/FileSystem.ts +7 -5
- package/src/IO/Output.ts +1 -1
- package/src/Reporters/ConsoleReporter.ts +14 -12
- package/src/Reporters/FileReporter.ts +7 -5
- package/src/Reporters/JUnitReporter.ts +3 -2
- package/src/Reporters/ResultReporter.ts +4 -3
- package/src/Reporters/SonarReporter.ts +4 -2
- package/src/Reporters/XMLReporter.ts +2 -2
- package/src/Runners/Runner.ts +5 -5
- package/src/Runners/TestRunner.ts +19 -11
- package/src/Runners/TestSuiteLoader.ts +14 -7
- package/src/Runners/TestSuiteRunner.ts +7 -7
- package/tsconfig.json +3 -0
- package/xunit.ts +3 -4
|
@@ -20,10 +20,10 @@ class TestSuiteRunner {
|
|
|
20
20
|
}
|
|
21
21
|
runSuite(suite, filters) {
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
|
|
23
|
+
this.reporters.map(r => r.suiteStarted(suite));
|
|
24
24
|
const tests = suite.getTests(filters);
|
|
25
25
|
const results = yield this.runTests(suite, tests);
|
|
26
|
-
|
|
26
|
+
this.reporters.map(r => r.suiteCompleted(suite, results));
|
|
27
27
|
return results;
|
|
28
28
|
});
|
|
29
29
|
}
|
|
@@ -31,7 +31,7 @@ class TestSuiteRunner {
|
|
|
31
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
32
|
const results = new TestSuiteResults_1.default(suite);
|
|
33
33
|
if (tests === undefined || tests === null || Object.keys(tests).length === 0) {
|
|
34
|
-
|
|
34
|
+
this.reporters.map(r => r.testIncomplete(suite, "(no tests found)"));
|
|
35
35
|
return results;
|
|
36
36
|
}
|
|
37
37
|
const test_names = Object.keys(tests);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestSuiteRunner.js","sourceRoot":"","sources":["../../../src/Runners/TestSuiteRunner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,qFAA6D;AAI7D,MAAqB,eAAe;IAEnC,YAA6B,MAAkB,EAAmB,
|
|
1
|
+
{"version":3,"file":"TestSuiteRunner.js","sourceRoot":"","sources":["../../../src/Runners/TestSuiteRunner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,qFAA6D;AAI7D,MAAqB,eAAe;IAEnC,YAA6B,MAAkB,EAAmB,SAAoC;QAAzE,WAAM,GAAN,MAAM,CAAY;QAAmB,cAAS,GAAT,SAAS,CAA2B;IACtG,CAAC;IAEK,QAAQ,CAAC,KAAgB,EAAE,OAAiB;;YACjD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;YAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACtC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAClD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;YAC1D,OAAO,OAAO,CAAC;QAChB,CAAC;KAAA;IAEK,QAAQ,CAAC,KAAgB,EAAE,KAAuC;;YACvE,MAAM,OAAO,GAAG,IAAI,0BAAgB,CAAC,KAAK,CAAC,CAAC;YAC5C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9E,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC;gBACrE,OAAO,OAAO,CAAC;YAChB,CAAC;YAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtC,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;gBAC/B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;gBACnE,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACjC,CAAC;YAED,OAAO,OAAO,CAAC;QAChB,CAAC;KAAA;CACD;AA5BD,kCA4BC"}
|
package/dist/xunit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import Assert from "./src/Assertions";
|
|
1
2
|
import Test from "./src/Framework/Test";
|
|
2
3
|
import TestSuite from "./src/Framework/TestSuite";
|
|
3
|
-
|
|
4
|
-
export { Test, TestSuite, Assert };
|
|
4
|
+
export { Assert, Test, TestSuite };
|
|
5
5
|
//# sourceMappingURL=xunit.d.ts.map
|
package/dist/xunit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xunit.d.ts","sourceRoot":"","sources":["../xunit.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"xunit.d.ts","sourceRoot":"","sources":["../xunit.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,IAAI,MAAM,sBAAsB,CAAC;AACxC,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD,OAAO,EACN,MAAM,EACN,IAAI,EACJ,SAAS,EAAE,CAAC"}
|
package/dist/xunit.js
CHANGED
|
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.TestSuite = exports.Test = exports.Assert = void 0;
|
|
7
|
+
const Assertions_1 = __importDefault(require("./src/Assertions"));
|
|
8
|
+
exports.Assert = Assertions_1.default;
|
|
7
9
|
const Test_1 = __importDefault(require("./src/Framework/Test"));
|
|
8
10
|
exports.Test = Test_1.default;
|
|
9
11
|
const TestSuite_1 = __importDefault(require("./src/Framework/TestSuite"));
|
|
10
12
|
exports.TestSuite = TestSuite_1.default;
|
|
11
|
-
const Assertions_1 = __importDefault(require("./src/Assertions"));
|
|
12
|
-
exports.Assert = Assertions_1.default;
|
|
13
13
|
//# sourceMappingURL=xunit.js.map
|
package/dist/xunit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xunit.js","sourceRoot":"","sources":["../xunit.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAwC;AAKvC,eALM,cAAI,CAKN;AAJL,0EAAkD;AAKjD,oBALM,mBAAS,CAKN
|
|
1
|
+
{"version":3,"file":"xunit.js","sourceRoot":"","sources":["../xunit.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAsC;AAKrC,iBALM,oBAAM,CAKN;AAJP,gEAAwC;AAKvC,eALM,cAAI,CAKN;AAJL,0EAAkD;AAKjD,oBALM,mBAAS,CAKN"}
|
package/eslint.config.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import stylistic from "@stylistic/eslint-plugin";
|
|
3
|
+
import { defineConfig } from "eslint/config";
|
|
4
|
+
import sort from "eslint-plugin-simple-import-sort";
|
|
5
|
+
import tseslint from "typescript-eslint";
|
|
6
|
+
|
|
7
|
+
export default defineConfig([
|
|
8
|
+
{
|
|
9
|
+
ignores: ["dist"]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parser: tseslint.parser,
|
|
14
|
+
parserOptions: { projectService: true }
|
|
15
|
+
},
|
|
16
|
+
plugins: {
|
|
17
|
+
"@stylistic": stylistic,
|
|
18
|
+
"simple-import-sort": sort
|
|
19
|
+
},
|
|
20
|
+
files: ["**/*.ts"],
|
|
21
|
+
extends: [
|
|
22
|
+
js.configs.recommended,
|
|
23
|
+
tseslint.configs.recommended,
|
|
24
|
+
tseslint.configs.strictTypeChecked,
|
|
25
|
+
tseslint.configs.stylisticTypeChecked
|
|
26
|
+
],
|
|
27
|
+
rules: {
|
|
28
|
+
"indent": ["warn", "tab"],
|
|
29
|
+
"quotes": ["warn", "double"],
|
|
30
|
+
|
|
31
|
+
"simple-import-sort/imports": "warn",
|
|
32
|
+
"simple-import-sort/exports": "warn",
|
|
33
|
+
"sort-imports": "off",
|
|
34
|
+
|
|
35
|
+
"@stylistic/object-curly-spacing": ["warn", "always"],
|
|
36
|
+
"@stylistic/semi": ["error", "always"],
|
|
37
|
+
|
|
38
|
+
"@typescript-eslint/no-confusing-void-expression": "off",
|
|
39
|
+
"@typescript-eslint/no-extraneous-class": "off",
|
|
40
|
+
"@typescript-eslint/no-unsafe-function-type": "off",
|
|
41
|
+
"@typescript-eslint/restrict-template-expressions": "off"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,35 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xunit.ts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "A unit testing framework for TypeScript, following standard xUnit patterns",
|
|
5
5
|
"main": "dist/xunit.js",
|
|
6
6
|
"author": "ecoAPM LLC",
|
|
7
7
|
"homepage": "https://github.com/ecoAPM/xunit.ts",
|
|
8
|
+
"repository": "https://github.com/ecoAPM/xunit.ts",
|
|
8
9
|
"bugs": "https://github.com/ecoAPM/xunit.ts/issues",
|
|
9
10
|
"license": "MIT",
|
|
10
11
|
"engines": {
|
|
11
|
-
"node": ">=
|
|
12
|
+
"node": ">= 24"
|
|
12
13
|
},
|
|
13
14
|
"dependencies": {
|
|
14
15
|
"colors": "1.4.0",
|
|
15
|
-
"command-line-args": "
|
|
16
|
-
"command-line-usage": "7.0.
|
|
16
|
+
"command-line-args": "6.0.2",
|
|
17
|
+
"command-line-usage": "7.0.4",
|
|
17
18
|
"lodash.escaperegexp": "4.1.2",
|
|
18
19
|
"lodash.isequal": "4.5.0",
|
|
19
20
|
"xml": "1.0.1"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
24
|
-
"@types/
|
|
25
|
-
"@types/
|
|
26
|
-
"@types/
|
|
27
|
-
"@types/
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"eslint": "
|
|
23
|
+
"@eslint/js": "10.0.1",
|
|
24
|
+
"@stylistic/eslint-plugin": "5.10.0",
|
|
25
|
+
"@types/command-line-args": "5.2.3",
|
|
26
|
+
"@types/command-line-usage": "5.0.4",
|
|
27
|
+
"@types/lodash.escaperegexp": "4.1.9",
|
|
28
|
+
"@types/lodash.isequal": "4.5.8",
|
|
29
|
+
"@types/node": "25.9.3",
|
|
30
|
+
"@types/xml": "1.0.11",
|
|
31
|
+
"eslint": "10.4.1",
|
|
32
|
+
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
33
|
+
"jiti": "2.7.0",
|
|
31
34
|
"ts-mockito": "2.6.1",
|
|
32
|
-
"typescript": "
|
|
35
|
+
"typescript": "6.0.3",
|
|
36
|
+
"typescript-eslint": "8.61.0"
|
|
33
37
|
},
|
|
34
38
|
"peerDependencies": {
|
|
35
39
|
"typescript": ">= 4"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that an array contains a given element
|
|
@@ -15,13 +15,13 @@ import { AssertionError } from "assert";
|
|
|
15
15
|
* @example
|
|
16
16
|
* this.assert.contains(needle, haystack);
|
|
17
17
|
*/
|
|
18
|
-
export default function Contains<T>(needle: T, haystack:
|
|
18
|
+
export default function Contains<T>(needle: T, haystack: readonly T[], message?: string) {
|
|
19
19
|
if (haystack.includes(needle)) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
throw new AssertionError({
|
|
24
|
-
message: message
|
|
24
|
+
message: message ?? "Expected array containing expression, but array did not contain expression",
|
|
25
25
|
expected: needle,
|
|
26
26
|
actual: haystack
|
|
27
27
|
});
|
package/src/Assertions/Count.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that an array contains a certain number of elements
|
|
@@ -15,13 +15,13 @@ import { AssertionError } from "assert";
|
|
|
15
15
|
* @example
|
|
16
16
|
* this.assert.count(expected, array);
|
|
17
17
|
*/
|
|
18
|
-
export default function Count(expected: number, array:
|
|
18
|
+
export default function Count(expected: number, array: readonly unknown[], message?: string) {
|
|
19
19
|
if (array.length === expected) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
throw new AssertionError({
|
|
24
|
-
message: message
|
|
24
|
+
message: message ?? `Expected array with ${expected} elements, but array had ${array.length} elements`,
|
|
25
25
|
expected: expected,
|
|
26
26
|
actual: array.length
|
|
27
27
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that a value is defined (any value other than `undefined`)
|
|
@@ -14,13 +14,13 @@ import { AssertionError } from "assert";
|
|
|
14
14
|
* @example
|
|
15
15
|
* this.assert.defined(expression);
|
|
16
16
|
*/
|
|
17
|
-
export default function Defined(expression:
|
|
17
|
+
export default function Defined(expression: unknown, message?: string) {
|
|
18
18
|
if (expression !== undefined) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
throw new AssertionError({
|
|
23
|
-
message: message
|
|
23
|
+
message: message ?? "Expected expression to be defined, but expression is undefined",
|
|
24
24
|
expected: "(not undefined expression)",
|
|
25
25
|
actual: expression
|
|
26
26
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that an array does not contain a given element
|
|
@@ -15,13 +15,13 @@ import { AssertionError } from "assert";
|
|
|
15
15
|
* @example
|
|
16
16
|
* this.assert.doesNotContain(needle, haystack);
|
|
17
17
|
*/
|
|
18
|
-
export default function DoesNotContain<T>(needle: T, haystack:
|
|
18
|
+
export default function DoesNotContain<T>(needle: T, haystack: readonly T[], message?: string) {
|
|
19
19
|
if (!haystack.includes(needle)) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
throw new AssertionError({
|
|
24
|
-
message: message
|
|
24
|
+
message: message ?? "Expected array not containing expression, but array contained expression",
|
|
25
25
|
expected: needle,
|
|
26
26
|
actual: haystack
|
|
27
27
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that an expression does not throw an error/exception
|
|
@@ -14,13 +14,13 @@ import { AssertionError } from "assert";
|
|
|
14
14
|
* @example
|
|
15
15
|
* this.assert.doesNotThrow(() => expression);
|
|
16
16
|
*/
|
|
17
|
-
export default function DoesNotThrow(expression: () =>
|
|
17
|
+
export default function DoesNotThrow(expression: () => unknown, message?: string) {
|
|
18
18
|
try {
|
|
19
19
|
expression();
|
|
20
20
|
return;
|
|
21
21
|
} catch (exception) {
|
|
22
22
|
throw new AssertionError({
|
|
23
|
-
message: message
|
|
23
|
+
message: message ?? "Expected expression to not throw exception, but expression did throw exception",
|
|
24
24
|
expected: "(no exception)",
|
|
25
25
|
actual: exception
|
|
26
26
|
});
|
package/src/Assertions/Empty.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that an array is empty
|
|
@@ -14,13 +14,13 @@ import { AssertionError } from "assert";
|
|
|
14
14
|
* @example
|
|
15
15
|
* this.assert.empty(array);
|
|
16
16
|
*/
|
|
17
|
-
export default function Empty(array:
|
|
17
|
+
export default function Empty(array: readonly unknown[], message?: string) {
|
|
18
18
|
if (array.length === 0) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
throw new AssertionError({
|
|
23
|
-
message: message
|
|
23
|
+
message: message ?? "Expected expression to be empty, but expression was not empty",
|
|
24
24
|
expected: [],
|
|
25
25
|
actual: array
|
|
26
26
|
});
|
package/src/Assertions/Equal.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
|
+
|
|
2
3
|
import equal from "lodash.isequal";
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -16,13 +17,13 @@ import equal from "lodash.isequal";
|
|
|
16
17
|
* @example
|
|
17
18
|
* this.assert.equal(expected, actual);
|
|
18
19
|
*/
|
|
19
|
-
export default function Equal(expected:
|
|
20
|
+
export default function Equal(expected: unknown, actual: unknown, message?: string) {
|
|
20
21
|
if (equal(actual, expected)) {
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
throw new AssertionError({
|
|
25
|
-
message: message
|
|
26
|
+
message: message ?? "Expected expressions to be equal, but expressions are not equal",
|
|
26
27
|
expected: expected,
|
|
27
28
|
actual: actual,
|
|
28
29
|
});
|
package/src/Assertions/False.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that a given value is equal to `false`
|
|
@@ -14,13 +14,13 @@ import { AssertionError } from "assert";
|
|
|
14
14
|
* @example
|
|
15
15
|
* this.assert.false(expression);
|
|
16
16
|
*/
|
|
17
|
-
export default function False(expression:
|
|
17
|
+
export default function False(expression: unknown, message?: string) {
|
|
18
18
|
if (expression === false) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
throw new AssertionError({
|
|
23
|
-
message: message
|
|
23
|
+
message: message ?? "Expected expression to be false, but expression is not false",
|
|
24
24
|
expected: false,
|
|
25
25
|
actual: expression
|
|
26
26
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that a value is an instance of a certain type
|
|
@@ -15,13 +15,13 @@ import { AssertionError } from "assert";
|
|
|
15
15
|
* @example
|
|
16
16
|
* this.assert.instanceOf(type, object);
|
|
17
17
|
*/
|
|
18
|
-
export default function InstanceOf(type:
|
|
18
|
+
export default function InstanceOf(type: Function, expression: unknown, message?: string) {
|
|
19
19
|
if (expression instanceof type) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
throw new AssertionError({
|
|
24
|
-
message: message
|
|
24
|
+
message: message ?? `Expected expression of type, but was ${typeof expression}`,
|
|
25
25
|
expected: type.name,
|
|
26
26
|
actual: typeof expression
|
|
27
27
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that an array is not empty
|
|
@@ -14,13 +14,13 @@ import { AssertionError } from "assert";
|
|
|
14
14
|
* @example
|
|
15
15
|
* this.assert.notEmpty(array);
|
|
16
16
|
*/
|
|
17
|
-
export default function NotEmpty(array:
|
|
17
|
+
export default function NotEmpty(array: readonly unknown[], message?: string) {
|
|
18
18
|
if (array.length > 0) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
throw new AssertionError({
|
|
23
|
-
message: message
|
|
23
|
+
message: message ?? "Expected expression to be not empty, but expression was empty",
|
|
24
24
|
expected: "(non-empty expression)",
|
|
25
25
|
actual: array
|
|
26
26
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
|
+
|
|
2
3
|
import equal from "lodash.isequal";
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -16,13 +17,13 @@ import equal from "lodash.isequal";
|
|
|
16
17
|
* @example
|
|
17
18
|
* this.assert.notEqual(expected, actual);
|
|
18
19
|
*/
|
|
19
|
-
export default function NotEqual(expected:
|
|
20
|
+
export default function NotEqual(expected: unknown, actual: unknown, message?: string) {
|
|
20
21
|
if (!equal(actual, expected)) {
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
throw new AssertionError({
|
|
25
|
-
message: message
|
|
26
|
+
message: message ?? "Expected expressions to be not equal, but expressions are equal",
|
|
26
27
|
expected: expected,
|
|
27
28
|
actual: actual,
|
|
28
29
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that a value is not `null`
|
|
@@ -14,13 +14,13 @@ import { AssertionError } from "assert";
|
|
|
14
14
|
* @example
|
|
15
15
|
* this.assert.notNull(expression);
|
|
16
16
|
*/
|
|
17
|
-
export default function NotNull(expression:
|
|
17
|
+
export default function NotNull(expression: unknown, message?: string) {
|
|
18
18
|
if (expression !== null) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
throw new AssertionError({
|
|
23
|
-
message: message
|
|
23
|
+
message: message ?? "Expected expression to be not null, but expression is null",
|
|
24
24
|
expected: "(non-null expression)",
|
|
25
25
|
actual: expression
|
|
26
26
|
});
|
package/src/Assertions/Null.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that a value is `null`
|
|
@@ -14,13 +14,13 @@ import { AssertionError } from "assert";
|
|
|
14
14
|
* @example
|
|
15
15
|
* this.assert.null(expression);
|
|
16
16
|
*/
|
|
17
|
-
export default function Null(expression:
|
|
17
|
+
export default function Null(expression: unknown, message?: string) {
|
|
18
18
|
if (expression === null) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
throw new AssertionError({
|
|
23
|
-
message: message
|
|
23
|
+
message: message ?? "Expected expression to be null, but expression is not null",
|
|
24
24
|
expected: null,
|
|
25
25
|
actual: expression
|
|
26
26
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that a string contains a given substring
|
|
@@ -16,12 +16,12 @@ import { AssertionError } from "assert";
|
|
|
16
16
|
* this.assert.stringContains(needle, haystack);
|
|
17
17
|
*/
|
|
18
18
|
export default function StringContains(needle: string, haystack: string | null, message?: string) {
|
|
19
|
-
if (haystack
|
|
19
|
+
if (haystack?.includes(needle)) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
throw new AssertionError({
|
|
24
|
-
message: message
|
|
24
|
+
message: message ?? "Expected string containing expression, but string did not contain expression",
|
|
25
25
|
expected: needle,
|
|
26
26
|
actual: haystack
|
|
27
27
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that a string does not contain a given substring
|
|
@@ -16,12 +16,12 @@ import { AssertionError } from "assert";
|
|
|
16
16
|
* this.assert.stringDoesNotContain(needle, haystack);
|
|
17
17
|
*/
|
|
18
18
|
export default function StringDoesNotContain(needle: string, haystack: string | null, message?: string) {
|
|
19
|
-
if (haystack
|
|
19
|
+
if (!haystack?.includes(needle)) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
throw new AssertionError({
|
|
24
|
-
message: message
|
|
24
|
+
message: message ?? "Expected string not containing expression, but string did contain expression",
|
|
25
25
|
expected: needle,
|
|
26
26
|
actual: haystack
|
|
27
27
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that a string does not end with a given substring
|
|
@@ -16,14 +16,12 @@ import { AssertionError } from "assert";
|
|
|
16
16
|
* this.assert.stringDoesNotEndWith(needle, haystack);
|
|
17
17
|
*/
|
|
18
18
|
export default function StringDoesNotEndWith(needle: string, haystack: string | null, message?: string) {
|
|
19
|
-
if (haystack
|
|
20
|
-
|| haystack.indexOf(needle) === -1
|
|
21
|
-
|| haystack.indexOf(needle) !== haystack.length - needle.length) {
|
|
19
|
+
if (!haystack?.endsWith(needle)) {
|
|
22
20
|
return;
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
throw new AssertionError({
|
|
26
|
-
message: message
|
|
24
|
+
message: message ?? "Expected string containing expression, but string did not contain expression",
|
|
27
25
|
expected: needle,
|
|
28
26
|
actual: haystack
|
|
29
27
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Asserts that a string does not match a given regular expression
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Passes if `haystack` does not pass a `regex` test
|
|
8
|
+
*
|
|
9
|
+
* Fails if `haystack` passes a `regex` test
|
|
10
|
+
*
|
|
11
|
+
* @param regex the regular expression to test
|
|
12
|
+
* @param haystack the string to search
|
|
13
|
+
* @param message (optional) message to display on failure
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* this.assert.stringDoesNotMatch(regex, haystack);
|
|
17
|
+
*/
|
|
18
|
+
export default function StringDoesNotMatch(regex: RegExp, haystack?: string | null, message?: string) {
|
|
19
|
+
if (haystack === undefined || haystack === null || !regex.test(haystack)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
throw new AssertionError({
|
|
24
|
+
message: message ?? "Expected string not pass regular expression test, but string did pass",
|
|
25
|
+
expected: regex.test(haystack),
|
|
26
|
+
actual: haystack
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that a string does not begin with a given substring
|
|
@@ -16,12 +16,12 @@ import { AssertionError } from "assert";
|
|
|
16
16
|
* this.assert.stringDoesNotStartWith(needle, haystack);
|
|
17
17
|
*/
|
|
18
18
|
export default function StringDoesNotStartWith(needle: string, haystack: string | null, message?: string) {
|
|
19
|
-
if (haystack
|
|
19
|
+
if (!haystack?.startsWith(needle)) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
throw new AssertionError({
|
|
24
|
-
message: message
|
|
24
|
+
message: message ?? "Expected string containing expression, but string did not contain expression",
|
|
25
25
|
expected: needle,
|
|
26
26
|
actual: haystack
|
|
27
27
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssertionError } from "assert";
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that a string ends with a given substring
|
|
@@ -16,14 +16,12 @@ import { AssertionError } from "assert";
|
|
|
16
16
|
* this.assert.stringEndsWith(needle, haystack);
|
|
17
17
|
*/
|
|
18
18
|
export default function StringEndsWith(needle: string, haystack: string | null, message?: string) {
|
|
19
|
-
if (haystack
|
|
20
|
-
&& haystack.indexOf(needle) > -1
|
|
21
|
-
&& haystack.indexOf(needle) === haystack.length - needle.length) {
|
|
19
|
+
if (haystack?.endsWith(needle)) {
|
|
22
20
|
return;
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
throw new AssertionError({
|
|
26
|
-
message: message
|
|
24
|
+
message: message ?? "Expected string containing expression, but string did not contain expression",
|
|
27
25
|
expected: needle,
|
|
28
26
|
actual: haystack
|
|
29
27
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AssertionError } from "node:assert";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Asserts that a string matches a given regular expression
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Passes if `haystack` matches a `regex` test
|
|
8
|
+
*
|
|
9
|
+
* Fails if `haystack` does not match a `regex` test
|
|
10
|
+
*
|
|
11
|
+
* @param regex the regular expression to match
|
|
12
|
+
* @param haystack the string to search
|
|
13
|
+
* @param message (optional) message to display on failure
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* this.assert.stringMatches(regex, haystack);
|
|
17
|
+
*/
|
|
18
|
+
export default function StringMatches(regex: RegExp, haystack?: string | null, message?: string) {
|
|
19
|
+
if (haystack !== undefined && haystack !== null && regex.test(haystack)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
throw new AssertionError({
|
|
24
|
+
message: message ?? "Expected string to match regular expression, but string did not match",
|
|
25
|
+
expected: regex,
|
|
26
|
+
actual: haystack
|
|
27
|
+
});
|
|
28
|
+
}
|