Skip to content

Instantly share code, notes, and snippets.

@asalant
Last active November 10, 2016 22:04
Show Gist options
  • Save asalant/8a0268df09c6693a516d517d0875663e to your computer and use it in GitHub Desktop.
Save asalant/8a0268df09c6693a516d517d0875663e to your computer and use it in GitHub Desktop.
process.env.NODE_ENV = 'test' unless process.env.NODE_ENV?
sys = require "sys"
_ = require "underscore"
dir = "jasmine-node/lib/jasmine-node/"
filename = "jasmine-2.0.0.rc1"
# Copy 'it', 'describe',... to global
for key, value of require("#{dir}#{filename}")
global[key] = value
# Use jasmine-node's TerminalReporter for console output
TerminalReporter = require("#{dir}reporter").TerminalReporter
jasmine.getEnv().addReporter(new TerminalReporter(
print: sys.print
color: true
stackFilter: (text) ->
_(text.split /\n/).filter((line) -> line.indexOf("#{dir}#{filename}") == -1).join('\n')
))
process.nextTick ->
jasmine.getEnv().execute()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment