Last active
November 10, 2016 22:04
-
-
Save asalant/8a0268df09c6693a516d517d0875663e to your computer and use it in GitHub Desktop.
Used at https://medium.com/good-eggs-product/debugging-jasmine-node-and-coffeescript-specs-80884bf92b5c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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