Skip to content

Commit

Permalink
[tests] extract assert.{isFunction, name, arity, looksNative} helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Oct 5, 2015
1 parent 4ebdecd commit c0209d5
Show file tree
Hide file tree
Showing 194 changed files with 2,241 additions and 2,386 deletions.
1,142 changes: 556 additions & 586 deletions tests/es.js

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions tests/helpers.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tests/helpers/arity.ls
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
QUnit.assert.arity = !(fn, length, message)->
@push (fn.length is length), fn.length, length, message || "arity is #length"
2 changes: 2 additions & 0 deletions tests/helpers/isFunction.ls
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
QUnit.assert.isFunction = !(fn, message)->
@push (typeof fn is \function or typeof! fn is \Function), no, on, message || 'is function'
2 changes: 2 additions & 0 deletions tests/helpers/looksNative.ls
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
QUnit.assert.looksNative = !(fn, message)->
@push /native code/.test(Function::toString.call fn), no, on, message || 'looks native'
2 changes: 2 additions & 0 deletions tests/helpers/name.ls
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
QUnit.assert.name = !(fn, name, message)->
@push (fn.name is name), fn.name, name, message || "name is '#name'"
Loading

0 comments on commit c0209d5

Please sign in to comment.