aboutsummaryrefslogtreecommitdiffstats
path: root/src/psdassert.coffee
blob: 20a92e1484113e0af24666d15738d51f28b9ec6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
# Quick and dirty assertion polyfill for browsers
assert = do (assert) ->
  return require 'assert' if exports?

  assert = (test) ->
    throw "Assertion error" unless test == true

  assert.equal = (actual, expected) ->
    throw "Assertion error" unless actual is expected

  return assert