hermes-test 1.0.0 → 1.0.1
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/hermes-test.js +12 -0
- package/dist/harness.bundle.js +3 -0
- package/package.json +4 -4
- package/src/spy.ts +6 -0
package/bin/hermes-test.js
CHANGED
|
@@ -4,10 +4,22 @@
|
|
|
4
4
|
const { execFileSync } = require("child_process");
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const os = require("os");
|
|
7
|
+
const fs = require("fs");
|
|
7
8
|
|
|
8
9
|
const platform = os.platform();
|
|
9
10
|
const arch = os.arch();
|
|
10
11
|
|
|
12
|
+
// Check for local development build first (target/release/hermes-test next to the package)
|
|
13
|
+
const localBin = path.join(__dirname, "..", "..", "..", "target", "release", "hermes-test");
|
|
14
|
+
if (fs.existsSync(localBin)) {
|
|
15
|
+
try {
|
|
16
|
+
execFileSync(localBin, process.argv.slice(2), { stdio: "inherit" });
|
|
17
|
+
} catch (e) {
|
|
18
|
+
process.exit(e.status ?? 1);
|
|
19
|
+
}
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
|
|
11
23
|
const pkgMap = {
|
|
12
24
|
"darwin-arm64": "@hermes-test/darwin-arm64",
|
|
13
25
|
"darwin-x64": "@hermes-test/darwin-x64",
|
package/dist/harness.bundle.js
CHANGED
|
@@ -950,6 +950,9 @@ Run with --update-snapshots to update.`
|
|
|
950
950
|
returnValues.push(ret);
|
|
951
951
|
return ret;
|
|
952
952
|
};
|
|
953
|
+
if (impl && impl.prototype) {
|
|
954
|
+
fn.prototype = impl.prototype;
|
|
955
|
+
}
|
|
953
956
|
Object.defineProperties(fn, {
|
|
954
957
|
calls: { get: () => calls },
|
|
955
958
|
callCount: { get: () => calls.length },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hermes-test",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "26-64x faster than Jest. A test runner built for React Native and Expo. One esbuild pass, one process, zero Babel.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"react": ">=18"
|
|
55
55
|
},
|
|
56
56
|
"optionalDependencies": {
|
|
57
|
-
"@hermes-test/darwin-arm64": "1.0.
|
|
58
|
-
"@hermes-test/darwin-x64": "1.0.
|
|
59
|
-
"@hermes-test/linux-x64": "1.0.
|
|
57
|
+
"@hermes-test/darwin-arm64": "1.0.1",
|
|
58
|
+
"@hermes-test/darwin-x64": "1.0.1",
|
|
59
|
+
"@hermes-test/linux-x64": "1.0.1"
|
|
60
60
|
},
|
|
61
61
|
"files": [
|
|
62
62
|
"src/",
|
package/src/spy.ts
CHANGED
|
@@ -58,6 +58,12 @@ export function spy<F extends (...args: any[]) => any = () => void>(
|
|
|
58
58
|
return ret;
|
|
59
59
|
} as unknown as Spy<F>;
|
|
60
60
|
|
|
61
|
+
// Preserve prototype chain so `new spy(...)` creates instances with the
|
|
62
|
+
// original class's prototype methods (e.g. class methods like write()).
|
|
63
|
+
if (impl && impl.prototype) {
|
|
64
|
+
fn.prototype = impl.prototype;
|
|
65
|
+
}
|
|
66
|
+
|
|
61
67
|
Object.defineProperties(fn, {
|
|
62
68
|
calls: { get: () => calls },
|
|
63
69
|
callCount: { get: () => calls.length },
|