Skip to content

Commit

Permalink
adding very simple tests for main calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Idrinth committed Dec 1, 2020
1 parent 8b1e2fe commit ab1efc0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.',);
},);
},);

0 comments on commit ab1efc0

Please sign in to comment.