Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
Manually handles the exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed May 8, 2024
1 parent 7dca97c commit bb1f585
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/runTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

0 comments on commit bb1f585

Please sign in to comment.