From bb1f585e3298226dd814c5696e9869786a73bd62 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Wed, 8 May 2024 19:44:40 +0900 Subject: [PATCH] Manually handles the exit code --- test/runTest.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/runTest.js b/test/runTest.js index 5459db5..76882d2 100644 --- a/test/runTest.js +++ b/test/runTest.js @@ -18,20 +18,22 @@ const backupConfigPath = `${projectConfigPath}.bak`; async function main() { fs.renameSync(projectConfigPath, backupConfigPath); + let exitCode = 1; + try { // Download VS Code, unzip it and run the integration test - await runTests({ + exitCode = await runTests({ extensionDevelopmentPath, extensionTestsPath, launchArgs: ["--user-data-dir", path.join(os.tmpdir(), "yamlfmt-test")], }); - } catch (err) { console.error("Failed to run tests", err); - throw new Error(`Failed to run tests: ${err}`); - } finally { - fs.renameSync(backupConfigPath, projectConfigPath); } + + fs.renameSync(backupConfigPath, projectConfigPath); + + process.exit(exitCode); } main();