tangled
alpha
login
or
join now
danabra.mov
/
rscexplorer
37
fork
atom
A tool for people curious about the React Server Components protocol
rscexplorer.dev/
rsc
react
37
fork
atom
overview
issues
pulls
pipelines
maybe fix tests
danabra.mov
2 months ago
435e7038
d7f4ce64
0/1
ci.yaml
failed
6s
+9
-39
5 changed files
expand all
collapse all
unified
split
.github
workflows
ci.yml
.tangled
workflows
ci.yaml
package.json
tests
globalSetup.js
vitest.config.js
+1
.github/workflows/ci.yml
···
16
16
node-version: 22
17
17
cache: npm
18
18
- run: npm install
19
19
+
- run: npx playwright install --with-deps chromium
19
20
- run: npm test
20
21
- run: npm run build:versions
+2
.tangled/workflows/ci.yaml
···
10
10
steps:
11
11
- name: install
12
12
command: npm install
13
13
+
- name: install playwright
14
14
+
command: npx playwright install --with-deps chromium
13
15
- name: test
14
16
command: npm test
15
17
- name: build versions
+1
-1
package.json
···
10
10
"build:versions": "node scripts/build-version.js --all",
11
11
"dev": "vite",
12
12
"preview": "vite preview",
13
13
-
"deploy": "npm install && npm test && npm run build:versions && wrangler pages deploy dist --project-name=rscexplorer",
13
13
+
"deploy": "npm install && npm run lint && npm test && npm run build:versions && wrangler pages deploy dist --project-name=rscexplorer",
14
14
"test": "vitest run --reporter=verbose",
15
15
"lint": "eslint .",
16
16
"format": "prettier --write .",
-37
tests/globalSetup.js
···
1
1
-
import { spawn, execSync } from "child_process";
2
2
-
3
3
-
let devServer;
4
4
-
5
5
-
export async function setup() {
6
6
-
await new Promise((resolve, reject) => {
7
7
-
devServer = spawn("npm", ["run", "dev", "--", "--port", "5599"], {
8
8
-
stdio: ["ignore", "pipe", "pipe"],
9
9
-
detached: false,
10
10
-
});
11
11
-
12
12
-
devServer.stdout.on("data", (data) => {
13
13
-
if (data.toString().includes("Local:")) {
14
14
-
resolve();
15
15
-
}
16
16
-
});
17
17
-
18
18
-
devServer.stderr.on("data", (data) => {
19
19
-
console.error(data.toString());
20
20
-
});
21
21
-
22
22
-
devServer.on("error", reject);
23
23
-
24
24
-
// Timeout after 30s
25
25
-
setTimeout(() => reject(new Error("Dev server failed to start")), 30000);
26
26
-
});
27
27
-
}
28
28
-
29
29
-
export async function teardown() {
30
30
-
if (devServer) {
31
31
-
devServer.kill("SIGTERM");
32
32
-
// Also kill any process on the port
33
33
-
try {
34
34
-
execSync("lsof -ti:5599 | xargs kill -9 2>/dev/null || true");
35
35
-
} catch {}
36
36
-
}
37
37
-
}
+5
-1
vitest.config.js
···
4
4
test: {
5
5
testTimeout: 15000,
6
6
fileParallelism: true,
7
7
-
globalSetup: "./tests/globalSetup.js",
7
7
+
webServer: {
8
8
+
command: "npm run dev -- --port 5599",
9
9
+
port: 5599,
10
10
+
reuseExistingServer: !process.env.CI,
11
11
+
},
8
12
},
9
13
});