1
1
#!/usr/bin/env zx
2
2
import 'zx/globals'
3
3
4
- // Vitest would otherwise enable watch mode by default.
5
- process . env . CI = '1'
6
-
7
4
const playgroundDir = path . resolve ( __dirname , '../playground/' )
8
5
let projects = fs
9
6
. readdirSync ( playgroundDir , { withFileTypes : true } )
@@ -21,7 +18,13 @@ for (const projectName of projects) {
21
18
cd ( path . resolve ( playgroundDir , projectName ) )
22
19
const packageJSON = require ( path . resolve ( playgroundDir , projectName , 'package.json' ) )
23
20
24
- console . log ( `Building ${ projectName } ` )
21
+ console . log ( `
22
+
23
+ #####
24
+ Building ${ projectName }
25
+ #####
26
+
27
+ ` )
25
28
await $ `pnpm build`
26
29
27
30
if ( '@playwright/test' in packageJSON . devDependencies ) {
@@ -35,6 +38,16 @@ for (const projectName of projects) {
35
38
36
39
if ( 'test:unit' in packageJSON . scripts ) {
37
40
console . log ( `Running unit tests in ${ projectName } ` )
38
- await $ `pnpm test:unit`
41
+ if ( projectName . includes ( 'vitest' ) || projectName . includes ( 'with-tests' ) ) {
42
+ // Vitest would otherwise enable watch mode by default.
43
+ await $ `CI=1 pnpm test:unit`
44
+ } else {
45
+ await $ `pnpm test:unit`
46
+ }
47
+ }
48
+
49
+ if ( 'type-check' in packageJSON . scripts ) {
50
+ console . log ( `Running type-check in ${ projectName } ` )
51
+ await $ `pnpm type-check`
39
52
}
40
53
}
0 commit comments