Skip to content

Commit c528828

Browse files
committed
chore: increase server test timeout, fix yarn build:clean (#9336)
In #9325, I added a few fixtures to the `@redwoodjs/api-server` package that include dist files. `yarn build:clean` deletes all dist directories in all packages (the glob is `packages/**/dist`), so `yarn rwfw project:sync` ended up deleting twenty or so files. This PR makes `yarn build:clean` a little smarter. I couldn't see a way to do it via the `rimraf` CLI, so I just made a script. This PR also increases the timeout in the server tests which were a little flakey.
1 parent 7371273 commit c528828

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
],
1313
"scripts": {
1414
"build": "lerna run build",
15-
"build:clean": "yarn clean:prisma && rimraf \"packages/**/dist\" --glob",
15+
"build:clean": "yarn node ./tasks/clean.mjs",
1616
"build:clean:super": "git clean -fdx && yarn && yarn build",
1717
"build:link": "node ./tasks/build-and-copy",
1818
"build:test-project": "node ./tasks/test-project/test-project",

tasks/clean.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env node
2+
/* eslint-env node */
3+
4+
import { rimraf } from 'rimraf'
5+
import { $ } from 'zx'
6+
7+
await $`yarn clean:prisma`
8+
9+
await rimraf('packages/**/dist', {
10+
glob: {
11+
ignore: 'packages/**/{fixtures,__fixtures__}/**/dist',
12+
},
13+
})

tasks/server-tests/jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/** @type {import('jest').Config} */
22
const config = {
33
rootDir: '.',
4+
testTimeout: 5_000 * 2,
45
}
56

67
module.exports = config

tasks/server-tests/server.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ afterEach(async () => {
3434
}
3535
})
3636

37-
const TIMEOUT = 1_500
37+
const TIMEOUT = 1_000 * 2
3838

3939
const commandStrings = {
4040
'@redwoodjs/cli': `node ${path.resolve(

0 commit comments

Comments
 (0)