test: Always collect coverage

But only set the threshold when running unit tests specifically.
This way coverage for single classes can easily be tested.
This commit is contained in:
Joachim Van Herwegen
2021-01-18 11:46:35 +01:00
parent a46cd2bb3e
commit af88e130ff
4 changed files with 18 additions and 10 deletions

View File

@@ -157,7 +157,9 @@ describe('CliRunner', (): void => {
it('exits with output to stderr when instantiation fails.', async(): Promise<void> => {
manager.instantiate.mockRejectedValueOnce(new Error('Fatal'));
new CliRunner().run();
new CliRunner().run({
argv: [ 'node', 'script' ],
});
await new Promise((resolve): any => setImmediate(resolve));
expect(write).toHaveBeenCalledTimes(2);