Skip to content

Instantly share code, notes, and snippets.

@dbernar1
Last active August 29, 2015 14:03
Show Gist options
  • Save dbernar1/dece736fa5f9bc062f9e to your computer and use it in GitHub Desktop.
Save dbernar1/dece736fa5f9bc062f9e to your computer and use it in GitHub Desktop.
If internal details of a commonJS module were to be unit tested...
thereAreNo = ( items_in_array ) ->
items_in_array.length == 0
module.tests.thereAreNo: () ->
assert thereAreNo []
assert.fail thereAreNo [ 1 ]
assert.throws ->
thereAreNo 1
, /is not an array/
module.exports = class Life
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment