From 0a353948bc5bc137e6147e3aa83738b69d453265 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Thu, 18 Nov 2021 16:38:16 +0800 Subject: [PATCH] test: run build before e2e test --- test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test.js b/test.js index 51fe1561..c80ebd39 100644 --- 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), -- 2.39.5