Skip to content
Permalink
Browse files

Merge pull request #531 from koenbok/feature/code-coverage

Feature/code coverage
  • Loading branch information
nvh committed Jul 14, 2017
2 parents 026c816 + baba33d commit 60674ee5eb7b34eb19fd6dfe5b0f3a7ae036d4bd
@@ -74,3 +74,13 @@ site-upload: bootstrap site-build

resources:
scripts/resources-optimize.sh


# Code coverage

coverage: bootstrap
$(BIN)/gulp version
mkdir -p ./build/build
$(BIN)/coffeeCoverage -t istanbul -c __coverage__ ./build/Version.coffee ./build/build/Version.js
$(BIN)/coffeeCoverage -t istanbul -c __coverage__ ./framer ./build/instrumented
$(BIN)/gulp coverage
@@ -0,0 +1,7 @@
coverage:
precision: 1
range: 40..95

codecov:
branch: master
strict_yaml_branch: master
@@ -2,6 +2,7 @@ _ = require("lodash")
async = require("async")
gulp = require("gulp")
phantomjs = require("gulp-mocha-phantomjs")
istanbulReport = require('gulp-istanbul-report')
webpack = require("webpack")
rename = require("gulp-rename")
template = require("gulp-template")
@@ -34,10 +35,11 @@ gulp.task "test", ["webpack:tests", "lint"], ->
return gulp
.src("test/phantomjs/index.html")
.pipe(phantomjs({
reporter: "dot",
viewportSize: {width: 1024, height: 768},
useColors: true,
loadImages: false
reporter: "dot"
phantomjs:
# viewportSize: {width: 1024, height: 768}
useColors: true
loadImages: false
}))

gulp.task 'lint', ->
@@ -109,6 +111,45 @@ gulp.task "webpack:tests", ["webpack:debug"], (callback) ->
webpackDev("webpack:tests", config, callback)


gulp.task "webpack:coverage", ["version"], (callback) ->

config = _.extend WEBPACK,
entry: "./build/instrumented/Framer.js"
output:
filename: "build/framer.debug.js"
debug: true

webpackDev("webpack:coverage", config, callback)

gulp.task "coverage", ["version", "webpack:coverage", "webpack:tests"], ->
coverageFile = "build/coverage/coverage.json"
return gulp
.src("test/phantomjs/index.html")
.pipe(phantomjs(
phantomjs:
hooks: "mocha-phantomjs-istanbul"
coverageFile: coverageFile
# viewportSize: {width: 1024, height: 768}
useColors: true
loadImages: false
reporter: "dot"
))
.on "finish", ->
gulp.src(coverageFile)
.pipe(istanbulReport(
reporterOpts:
dir: './build/coverage'
reporters: [
'text',
{'name': 'lcov', file: 'lcov.info'},
{'name': 'json', file: 'coverage-final.json'},
{'name': 'clover', file: 'clover.xml'},
]
))
console.log "done"



################################################################################
# Utilities

@@ -18,13 +18,15 @@
"async": "^2.0.1",
"bower": "^1.3.12",
"chai": "^3.5.0",
"coffee-coverage": "^1.0.1",
"codecov": "^2.2.0",
"coffee-coverage": "^2.0.1",
"coffee-loader": "^0.7.2",
"coffee-script": "^1.9.1",
"eventemitter3": "^1.1.1",
"gulp": "^3.8.11",
"gulp-coffeelint": "^0.6.0",
"gulp-mocha-phantomjs": "^0.11.0",
"gulp-istanbul-report": "0.0.1",
"gulp-mocha-phantomjs": "^0.12.1",
"gulp-plumber": "^1.0.1",
"gulp-rename": "^1.2.2",
"gulp-template": "^4.0.0",
@@ -35,6 +37,7 @@
"mime": "^1.3.4",
"mocha": "^3.0.0",
"mocha-phantomjs": "^4.0.1",
"mocha-phantomjs-istanbul": "0.0.2",
"mustache": "^2.0.0",
"simulate": "^0.0.5",
"webpack": "^1.7.3",

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.

0 comments on commit 60674ee

Please sign in to comment.
You can’t perform that action at this time.