I have a web app written in Coffeescript that I'm testing with nodeunit, and I can't seem to get access to global variables ("session" vars in the app) set in the test:
src/test.coffee
root = exports ? this
this.test_exports = ->
console.log root.export
root.export
test/test.coffee
exports["test"] = (test) ->
exports.export = "test"
test.equal test_file.test_exports(), "test"
test.done()
Results in output:
test.coffee
undefined
✖ test
AssertionError: undefined == 'test'
How do I access globals across tests?
b-Flag. This prevents the security closure from being added.nice -n 19 coffee -o web/ -b -c -w src/, I added the -b to Trevor Burnham's continuous Cakefile build = (watch, callback) -> if typeof watch is 'function' callback = watch watch = false options = ['-b', '-c', '-o', 'lib', 'src'] options.unshift '-w' if watch but no dice.