@unrift/core 0.2.1 → 0.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/bin/unrift.mjs +2 -1
- package/dist/esm/cli.js +19 -13
- package/dist/esm/context.d.ts +1 -2
- package/dist/esm/context.d.ts.map +1 -1
- package/dist/esm/expect.d.ts +21 -1
- package/dist/esm/expect.d.ts.map +1 -1
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/interface.d.ts +3 -3
- package/dist/esm/interface.d.ts.map +1 -1
- package/dist/esm/interface.js +11 -6
- package/dist/esm/matchers.d.ts.map +1 -1
- package/dist/esm/matchers.js +261 -1
- package/dist/esm/mock/auto.d.ts +27 -0
- package/dist/esm/mock/auto.d.ts.map +1 -0
- package/dist/esm/mock/auto.js +108 -0
- package/dist/esm/mock/fetch.d.ts +47 -0
- package/dist/esm/mock/fetch.d.ts.map +1 -0
- package/dist/esm/mock/fetch.js +149 -0
- package/dist/esm/mock/fs.d.ts +54 -0
- package/dist/esm/mock/fs.d.ts.map +1 -0
- package/dist/esm/mock/fs.js +125 -0
- package/dist/esm/mock/index.d.ts +70 -0
- package/dist/esm/mock/index.d.ts.map +1 -0
- package/dist/esm/mock/index.js +70 -0
- package/dist/esm/mock/module-loader.d.ts +66 -0
- package/dist/esm/mock/module-loader.d.ts.map +1 -0
- package/dist/esm/mock/module-loader.js +123 -0
- package/dist/esm/mock/module.d.ts +99 -0
- package/dist/esm/mock/module.d.ts.map +1 -0
- package/dist/esm/mock/module.js +198 -0
- package/dist/esm/mock/register-loader.d.ts +17 -0
- package/dist/esm/mock/register-loader.d.ts.map +1 -0
- package/dist/esm/mock/register-loader.js +45 -0
- package/dist/esm/mock/spy.d.ts +73 -0
- package/dist/esm/mock/spy.d.ts.map +1 -0
- package/dist/esm/mock/spy.js +307 -0
- package/dist/esm/mock/stub.d.ts +26 -0
- package/dist/esm/mock/stub.d.ts.map +1 -0
- package/dist/esm/mock/stub.js +82 -0
- package/dist/esm/mock/timers.d.ts +51 -0
- package/dist/esm/mock/timers.d.ts.map +1 -0
- package/dist/esm/mock/timers.js +581 -0
- package/dist/esm/runner.d.ts +1 -0
- package/dist/esm/runner.d.ts.map +1 -1
- package/dist/esm/runner.js +138 -28
- package/dist/esm/test.d.ts +3 -2
- package/dist/esm/test.d.ts.map +1 -1
- package/dist/esm/test.js +17 -7
- package/dist/esm/types.d.ts +0 -1
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/types.js +0 -1
- package/dist/esm/utils/compareEngine.d.ts.map +1 -1
- package/dist/esm/utils/compareEngine.js +32 -1
- package/dist/esm/utils/defineConfig.d.ts +0 -1
- package/dist/esm/utils/defineConfig.d.ts.map +1 -1
- package/dist/esm/utils/diff.d.ts.map +1 -1
- package/dist/esm/utils/diff.js +31 -0
- package/dist/esm/utils/discoverTestFiles.js +1 -1
- package/dist/esm/utils/helpers.d.ts +21 -0
- package/dist/esm/utils/helpers.d.ts.map +1 -1
- package/dist/esm/utils/helpers.js +97 -0
- package/dist/esm/utils/loadConfig.d.ts.map +1 -1
- package/dist/esm/utils/loadConfig.js +2 -2
- package/dist/esm/utils/toThrow.d.ts.map +1 -1
- package/dist/esm/utils/toThrow.js +2 -1
- package/package.json +8 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { toImportUrl } from "./transform.js";
|
|
2
|
+
import { toError } from "./toError.js";
|
|
2
3
|
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
3
4
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
4
5
|
/**
|
|
@@ -18,8 +19,7 @@ async function importConfigFile(configPath) {
|
|
|
18
19
|
return JSON.parse(raw);
|
|
19
20
|
}
|
|
20
21
|
catch (err) {
|
|
21
|
-
|
|
22
|
-
throw new Error(`Failed to parse JSON config at ${configPath}: ${msg}`);
|
|
22
|
+
throw new Error(`Failed to parse JSON config at ${configPath}: ${toError(err).message}`);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
const module = await import(toImportUrl(configPath, "bundle-config"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toThrow.d.ts","sourceRoot":"","sources":["../../../src/utils/toThrow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toThrow.d.ts","sourceRoot":"","sources":["../../../src/utils/toThrow.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,MAAM,GACN,MAAM,GACN,CAAC,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,KAAK,CAAC,GACnC;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,UAAU,WAAW;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,MAAM,CAAC;CACvB;AAgED,wBAAgB,OAAO,CACrB,QAAQ,EAAE,OAAO,EACjB,QAAQ,CAAC,EAAE,eAAe,EAC1B,KAAK,UAAQ,GACZ,WAAW,CAgEb"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { regexTest } from "./helpers.js";
|
|
1
2
|
function isErrorConstructor(err) {
|
|
2
3
|
return typeof err === "function";
|
|
3
4
|
}
|
|
@@ -24,7 +25,7 @@ function matchThrown(thrown, expected) {
|
|
|
24
25
|
}
|
|
25
26
|
// toThrow(/regex/)
|
|
26
27
|
if (expected instanceof RegExp) {
|
|
27
|
-
return expected
|
|
28
|
+
return regexTest(expected, msg);
|
|
28
29
|
}
|
|
29
30
|
// toThrow(ErrorClass)
|
|
30
31
|
if (isErrorConstructor(expected)) {
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unrift/core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Core engine for the Unrift TypeScript test framework - runner, matchers, CLI, and programmatic API",
|
|
5
5
|
"private": false,
|
|
6
|
+
"sideEffects": false,
|
|
6
7
|
"main": "./dist/cjs/index.cjs",
|
|
7
8
|
"module": "./dist/esm/index.js",
|
|
8
9
|
"types": "./dist/esm/index.d.ts",
|
|
@@ -53,8 +54,12 @@
|
|
|
53
54
|
},
|
|
54
55
|
"homepage": "https://unrift.pages.dev",
|
|
55
56
|
"license": "MIT",
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"access": "public"
|
|
59
|
+
},
|
|
56
60
|
"dependencies": {
|
|
57
|
-
"esbuild": "^0.27.2"
|
|
61
|
+
"esbuild": "^0.27.2",
|
|
62
|
+
"memfs": "^4.57.7"
|
|
58
63
|
},
|
|
59
64
|
"devDependencies": {
|
|
60
65
|
"ts-node": "^10.9.2",
|