nodeunitでテストしているCoffeescriptで記述されたWebアプリがあり、テストで設定されたグローバル変数(アプリの「セッション」変数)にアクセスできないようです。
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()
出力の結果:
test.coffee
undefined
✖ test
AssertionError: undefined == 'test'
テスト間でグローバルにアクセスするにはどうすればよいですか?