cake test: count number of complete tests that pass, not assertions
This commit is contained in:
parent
1c86aee7a4
commit
683b3afbc1
12
Cakefile
12
Cakefile
|
@ -161,16 +161,7 @@ runTests = (CoffeeScript) ->
|
||||||
passedTests = 0
|
passedTests = 0
|
||||||
failures = []
|
failures = []
|
||||||
|
|
||||||
# Make "global" reference available to tests
|
global[name] = func for name, func of require 'assert'
|
||||||
global.global = global
|
|
||||||
|
|
||||||
# Mix in the assert module globally, to make it available for tests.
|
|
||||||
addGlobal = (name, func) ->
|
|
||||||
global[name] = ->
|
|
||||||
passedTests += 1
|
|
||||||
func arguments...
|
|
||||||
|
|
||||||
addGlobal name, func for name, func of require 'assert'
|
|
||||||
|
|
||||||
# Convenience aliases.
|
# Convenience aliases.
|
||||||
global.eq = global.strictEqual
|
global.eq = global.strictEqual
|
||||||
|
@ -181,6 +172,7 @@ runTests = (CoffeeScript) ->
|
||||||
try
|
try
|
||||||
fn.test = {description, currentFile}
|
fn.test = {description, currentFile}
|
||||||
fn.call(fn)
|
fn.call(fn)
|
||||||
|
++passedTests
|
||||||
catch e
|
catch e
|
||||||
e.description = description if description?
|
e.description = description if description?
|
||||||
e.source = fn.toString() if fn.toString?
|
e.source = fn.toString() if fn.toString?
|
||||||
|
|
Loading…
Reference in New Issue