Skip to content

Commit

Permalink
Destroy context on fail (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
timbrinded authored Dec 22, 2023
1 parent 810d1de commit f13dfc2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/cli/src/cmds/runTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function testCmd(envName: string, additionalArgs?: object): Promise
clearNodeLogs();
}

if (env.foundation.type !== "dev") {
if (env.foundation.type === "zombie") {
process.env.MOON_EXIT = "true";
}

Expand Down Expand Up @@ -73,9 +73,10 @@ export async function executeTests(env: Environment, additionalArgs?: object) {
const { rtVersion, rtName } = Object.values(chainData[0])[0];
process.env.MOON_RTVERSION = rtVersion;
process.env.MOON_RTNAME = rtName;
} catch (e) {
console.error(e);
} finally {
await MoonwallContext.destroy();
} catch {
// No chain to test against
}
}

Expand Down

0 comments on commit f13dfc2

Please sign in to comment.