mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
cake test: count number of complete tests that pass, not assertions
This commit is contained in:
parent
1c86aee7a4
commit
683b3afbc1
1 changed files with 2 additions and 10 deletions
12
Cakefile
12
Cakefile
|
@ -161,16 +161,7 @@ runTests = (CoffeeScript) ->
|
|||
passedTests = 0
|
||||
failures = []
|
||||
|
||||
# Make "global" reference available to tests
|
||||
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'
|
||||
global[name] = func for name, func of require 'assert'
|
||||
|
||||
# Convenience aliases.
|
||||
global.eq = global.strictEqual
|
||||
|
@ -181,6 +172,7 @@ runTests = (CoffeeScript) ->
|
|||
try
|
||||
fn.test = {description, currentFile}
|
||||
fn.call(fn)
|
||||
++passedTests
|
||||
catch e
|
||||
e.description = description if description?
|
||||
e.source = fn.toString() if fn.toString?
|
||||
|
|
Loading…
Add table
Reference in a new issue