]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
test: run build before e2e test
authorHaoqun Jiang <haoqunjiang@gmail.com>
Thu, 18 Nov 2021 08:38:16 +0000 (16:38 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Thu, 18 Nov 2021 08:38:16 +0000 (16:38 +0800)
test.js

diff --git a/test.js b/test.js
index 51fe1561cd34725adb3011f565fb17ff85bfdd62..c80ebd396cc1a364fc2486788757ab06f1225225 100644 (file)
--- a/test.js
+++ b/test.js
@@ -19,6 +19,16 @@ for (const projectName of fs.readdirSync(playgroundDir)) {
       throw new Error(`Unit tests failed in ${projectName}`)
     }
 
+    console.log(`Building ${projectName}`)
+    const buildResult = spawnSync('pnpm', ['build'], {
+      cwd: path.resolve(playgroundDir, projectName),
+      stdio: 'inherit',
+      shell: true
+    })
+    if (buildResult.status !== 0) {
+      throw new Error(`Build failed in ${projectName}`)
+    }
+
     console.log(`Running e2e tests in ${projectName}`)
     const e2eTestResult = spawnSync('pnpm', ['test:e2e:ci'], {
       cwd: path.resolve(playgroundDir, projectName),