Skip to content

Commit 1006e2d

Browse files
authored
Integration tests (#343)
1 parent 4727faa commit 1006e2d

File tree

4 files changed

+53
-46
lines changed

4 files changed

+53
-46
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,12 @@ permissions:
1111
contents: read
1212

1313
jobs:
14-
ci:
15-
runs-on: ${{ matrix.runs-on }}
14+
lint-and-test:
15+
runs-on: ubuntu-latest
1616

1717
permissions:
1818
contents: read
1919

20-
strategy:
21-
matrix:
22-
node-version: [22.x, 24.x, 25.x]
23-
runs-on: ['ubuntu-latest']
24-
2520
steps:
2621
- name: Checkout code
2722
uses: actions/checkout@v5
@@ -36,17 +31,16 @@ jobs:
3631
with:
3732
cache: 'pnpm'
3833
check-latest: true
39-
node-version: ${{ matrix.node-version }}
34+
node-version: 24.x
4035

4136
- name: Install dependencies
42-
run: pnpm install --ignore-scripts
37+
run: pnpm install
4338

4439
- name: Lint code
4540
run: pnpm lint
4641

4742
- name: Check formatting
4843
run: pnpm format:check
4944

50-
- name: Run tests
51-
shell: 'script --return --quiet --command "bash {0}"'
45+
- name: Run unit tests
5246
run: pnpm test
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
pull_request:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
examples:
15+
name: examples (${{ matrix.node-version }})
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
contents: read
20+
21+
strategy:
22+
matrix:
23+
node-version: [22.x, 24.x, 25.x]
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v5
28+
with:
29+
persist-credentials: false
30+
31+
- name: Install pnpm
32+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
33+
34+
- name: Set up Node.js
35+
uses: actions/setup-node@v6
36+
with:
37+
cache: 'pnpm'
38+
check-latest: true
39+
node-version: ${{ matrix.node-version }}
40+
41+
- name: Install dependencies
42+
run: pnpm install
43+
44+
- name: Run integration tests
45+
run: pnpm test:examples

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"private": "true",
33
"scripts": {
4-
"build": "pnpm -r run build",
4+
"build": "pnpm --filter './packages/*' run --if-present build",
55
"format": "oxfmt --write .",
66
"format:check": "oxfmt --check .",
77
"lint": " pnpm -r run lint && oxlint .",
88
"lint:fix": "pnpm -r run lint:fix && oxlint --fix .",
9-
"test": "zx package.mjs --test",
9+
"test": "pnpm --filter './packages/*' run --if-present test",
10+
"test:examples": "pnpm --filter './examples/*' run test",
1011
"prep-for-dev": "zx package.mjs --prep-for-dev",
1112
"prep-for-release": "zx package.mjs --prep-for-release"
1213
},

package.mjs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ const starters = [
1818
'vue-typescript',
1919
]
2020

21-
if (process.argv.includes('--test')) {
22-
await runAllTests()
23-
}
24-
2521
if (process.argv.includes('--prep-for-dev')) {
2622
await prepForDev()
2723
}
@@ -76,35 +72,6 @@ async function prepForDev() {
7672
process.exit()
7773
}
7874

79-
async function runAllTests() {
80-
cd(join(root, 'packages/fastify-vite'))
81-
82-
await $`pnpm vitest run`
83-
await $`sleep 1`
84-
85-
if (process.stdout.isTTY) {
86-
for (const example of [
87-
'react-vanilla',
88-
'react-vanilla-spa',
89-
'react-vanilla-spa-ts',
90-
'react-vanilla-ts',
91-
'react-hydration',
92-
'react-next-mini',
93-
'react-streaming',
94-
'vue-vanilla',
95-
'vue-vanilla-spa',
96-
'vue-vanilla-ts',
97-
'vue-hydration',
98-
'vue-next-mini',
99-
'vue-streaming',
100-
]) {
101-
cd(join(root, 'examples', example))
102-
await $`node --test`
103-
}
104-
}
105-
process.exit()
106-
}
107-
10875
function getVersion(pkg) {
10976
const pkgJSON = JSON.parse(readFileSync(join(root, 'packages', pkg, 'package.json')))
11077
return pkgJSON.version

0 commit comments

Comments
 (0)