Skip to content

Commit 2cde058

Browse files
Merge pull request bokeh#2 from bokeh/master
Merged from Upstream.
2 parents 5554fb1 + 79ec21e commit 2cde058

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

bokehjs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/build
22
/node_modules
3+
/coverage
4+
.coverrun
35
*~
46
*.sw[opn]
57
*.bak

bokehjs/.istanbul.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
instrumentation:
2+
excludes: ['**/vendor/**']

bokehjs/gulp/tasks/test.coffee

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,23 @@ mocha = (options={}) ->
1212
(file) ->
1313
if @_files? then @_files.push(file.path) else @_files = [file.path]
1414
() ->
15-
args = [
16-
"node_modules/mocha/bin/_mocha",
17-
"--compilers", "coffee:coffee-script/register",
18-
"--reporter", argv.reporter ? "spec",
19-
"./test/index.coffee"
20-
].concat(@_files)
15+
if options.coverage? and options.coverage
16+
args = [
17+
"node_modules/.bin/istanbul",
18+
"cover",
19+
"node_modules/mocha/bin/_mocha",
20+
"--",
21+
"--compilers", "coffee:coffee-script/register",
22+
"--reporter", argv.reporter ? "spec",
23+
"./test/index.coffee"
24+
].concat(@_files)
25+
else
26+
args = [
27+
"node_modules/mocha/bin/_mocha",
28+
"--compilers", "coffee:coffee-script/register",
29+
"--reporter", argv.reporter ? "spec",
30+
"./test/index.coffee"
31+
].concat(@_files)
2132

2233
if argv.debug
2334
args.unshift("debug")
@@ -39,6 +50,9 @@ mocha = (options={}) ->
3950
process.on('SIGINT', handler)
4051
)
4152

53+
gulp.task "test:coverage", ["defaults:generate"], () ->
54+
gulp.src(["./test/all.coffee"]).pipe(mocha({coverage: true}))
55+
4256
gulp.task "test", ["defaults:generate"], () ->
4357
gulp.src(["./test/all.coffee"]).pipe(mocha())
4458

bokehjs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"cheerio": "^0.19.0",
2525
"coffeeify": "^0.7.0",
2626
"del": "^1.1.1",
27+
"istanbul": "^0.4.5",
2728
"gulp": "^3.9.0",
2829
"gulp-change": "^1.0.0",
2930
"gulp-insert": "^0.5.0",

0 commit comments

Comments
 (0)