Skip to content

Commit

Permalink
fix(tests): update tests for inside CI
Browse files Browse the repository at this point in the history
also make "codeframe" the default CI reporter

Signed-off-by: Charlike Mike Reagent <olsten.larck@gmail.com>
  • Loading branch information
Charlike Mike Reagent committed Jul 19, 2018
1 parent f1a8e14 commit 46e02d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function getRelativePath(fp) {

function getReporter(argv = {}) {
if (isCI) {
argv.reporter = 'tap'; // eslint-disable-line no-param-reassign
return reporters.codeframe;
}

if (typeof argv.reporter === 'string') {
Expand Down
5 changes: 4 additions & 1 deletion test/utils.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

const isCI = require('is-ci');
const test = require('../src');

const {
Expand Down Expand Up @@ -46,7 +47,9 @@ test('getParsedArgv gets correct when no env given', (t) => {
t.strictEqual(argv.foobar, 'hohoho');
});

test('getReporter returns default "mini" reporter when no argv', (t) => {
const testFn = isCI ? test.skip : test;

testFn('getReporter returns default "mini" reporter when no argv', (t) => {
const reporter = createReporter();

t.strictEqual(typeof getReporter(), 'function');
Expand Down

0 comments on commit 46e02d4

Please sign in to comment.