From 2df45b99a1e25d880ba0defaa7902178dde5c303 Mon Sep 17 00:00:00 2001 From: Joshua Byrd Date: Tue, 5 Dec 2023 15:18:33 +1000 Subject: [PATCH] Let Jest handle the thrown error --- test/test.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/test.js b/test/test.js index 32bfa43..2972541 100644 --- a/test/test.js +++ b/test/test.js @@ -109,12 +109,9 @@ afterAll(async () => { it('should build the generated project', async () => { process.chdir(generatedProjectRoot); - try { - let output = execSync('npx aunty build'); - console.log(output.toString()); - } catch (error) { - console.error(error.stdout.toString()); - } + // Should throw an error on non-zero exit code + let output = execSync('npx aunty build'); + console.log(output.toString()); const fileList = await fs.readdir(path.join(generatedProjectRoot, '.aunty/build'));