From ab1efc01d844c70805b2e153f7df31910a3367b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Tue, 1 Dec 2020 22:37:15 +0100 Subject: [PATCH] adding very simple tests for main calls --- test/main.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/test/main.ts b/test/main.ts index 77f2e3276..391dbc6e2 100644 --- a/test/main.ts +++ b/test/main.ts @@ -4,21 +4,26 @@ import { } from 'chai'; import 'mocha'; import Reporter from '../src/reporter/reporter'; -import { NullLogger } from '../src/logger/null-logger'; +import { + NullLogger, +} from '../src/logger/null-logger'; -const NOOPR: Reporter = () => {/* noop */}; +const NOOPR: Reporter = () => { /* noop */ }; +const ONE = 1; describe('main', () => { it('should be a function', () => { expect(main,).to.be.a('function',); },); it('can be called with 3 params', () => { - expect(() => main(1, 1, []),).to.not.throw; + expect(() => main(ONE, ONE, [],),).to.throw('Can\'t measure no tasks.',); },); it('can be called with 4 params', () => { - expect(() => main(1, 1, [], NOOPR),).to.not.throw; + expect(() => main(ONE, ONE, [], NOOPR,),) + .to.throw('Can\'t measure no tasks.',); },); it('can be called with 5 params', () => { - expect(() => main(1, 1, [], NOOPR, new NullLogger()),).to.not.throw; + expect(() => main(ONE, ONE, [], NOOPR, new NullLogger(),),) + .to.throw('Can\'t measure no tasks.',); },); },);