Skip to content

Commit

Permalink
chore(tasks/test): save coverage report to coverage folder
Browse files Browse the repository at this point in the history
  • Loading branch information
dtinth committed Dec 24, 2014
1 parent 562bbc3 commit 3b3557b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import launcher from 'browser-launcher'
import co from 'co'
import promisify from 'es6-promisify'
import gutil from 'gulp-util'
import fs from 'fs'

import path from '../config/path'
import testMiddleware from './support/test-middleware'
Expand Down Expand Up @@ -69,6 +70,18 @@ export function test() {
}
}

if (result.coverage) {
if (!fs.existsSync(path('coverage'))) {
fs.mkdirSync(path('coverage'))
}
fs.writeFileSync(
path('coverage', 'coverage.json'),
JSON.stringify(result.coverage),
'utf8'
)
log('coverage report written')
}

if (fail) throw new gutil.PluginError('test', 'Testing failed!')

} finally {
Expand Down

0 comments on commit 3b3557b

Please sign in to comment.