Skip to content

Commit 28410f7

Browse files
committed
Isolate issue
1 parent d992ba6 commit 28410f7

File tree

5 files changed

+43
-16
lines changed

5 files changed

+43
-16
lines changed

.github/workflows/check.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,14 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18-
lint:
19-
name: Lint
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v4
23-
- uses: actions/setup-node@v4
24-
with:
25-
node-version: lts/jod
26-
- run: npm ci
27-
- run: npm run lint
2818
test:
2919
strategy:
3020
fail-fast: false
3121
matrix:
3222
runner:
3323
- ubuntu-latest
34-
- windows-latest
35-
- macos-latest
3624
variant:
37-
- unit-tests
3825
- android-tests
39-
- ios-tests
4026
exclude:
4127
# iOS tests are only supported on macOS runners
4228
- runner: ubuntu-latest

apps/test-app/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"build:android": "react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist/res",
1010
"ios": "react-native run-ios --no-packager",
1111
"pod-install": "cd ios && pod install",
12-
"test:android": "mocha-remote --exit-on-error -- tsx ./scripts/run-tests.ts android",
12+
"test:android:original": "mocha-remote --exit-on-error -- tsx ./scripts/run-tests.ts android",
13+
"test:android": "mocha-remote --exit-on-error -- tsx ./scripts/fake-tests.ts",
1314
"test:ios": "mocha-remote --exit-on-error -- tsx ./scripts/run-tests.ts ios"
1415
},
1516
"dependencies": {
@@ -23,6 +24,7 @@
2324
"@react-native/metro-config": "0.79.0",
2425
"@react-native/typescript-config": "0.79.0",
2526
"@rnx-kit/metro-config": "^2.0.1",
27+
"@types/mocha": "^10.0.10",
2628
"@types/react": "^19.0.0",
2729
"bufout": "^0.3.3",
2830
"ferric-example": "^0.1.0",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import path from "node:path";
2+
3+
import { spawn } from "bufout";
4+
import { Client } from "mocha-remote-client";
5+
6+
const cwd = path.resolve(__dirname, "..");
7+
const env = {
8+
...process.env,
9+
FORCE_COLOR: "1",
10+
};
11+
12+
const metro = spawn("npx", ["react-native", "start", "--no-interactive"], {
13+
cwd,
14+
stdio: "inherit",
15+
outputPrefix: "[metro] ",
16+
env,
17+
});
18+
19+
// Create a client, which will automatically connect to the server on the default port (8090)
20+
const client = new Client({
21+
// Called when the server asks the client to run
22+
tests: () => {
23+
// write your tests here or require a package that calls the mocha globals
24+
describe("my thing", () => {
25+
it("works", () => {
26+
// yay!
27+
});
28+
});
29+
},
30+
});
31+
32+
metro.catch(console.error);

apps/test-app/tsconfig.node-scripts.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"emitDeclarationOnly": true,
66
"outDir": "dist",
77
"rootDir": "scripts",
8-
"types": ["node", "bufout"]
8+
"types": ["node", "bufout", "mocha"]
99
},
1010
"include": ["scripts/**/*.ts"],
1111
"exclude": []

package-lock.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)