Skip to content

Commit

Permalink
Add test that ensures "core" application is destroyed before cli exits
Browse files Browse the repository at this point in the history
  • Loading branch information
aedart committed Nov 2, 2024
1 parent 58db8e5 commit 699a369
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/cli/packages/cli/core-application.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,26 @@ describe('@aedart/cli', () => {

assert.strictEqual(cli.core === core, true, 'Incorrect "core" application')
});

it('destroys "core" application before cli exits', async () => {
let destroyInvoked = false;

const core = new Application();
core.destroying(() => {
destroyInvoked = true;
});

const cli = makeCliApplication({
writeOut: () => {
// Ignore output
}
}, core);

// --------------------------------------------------------------- //

await cli.run([], { from: 'user' });

assert.ok(destroyInvoked, '"core" application not destroyed');
});
});
});

0 comments on commit 699a369

Please sign in to comment.