Created
May 7, 2013 22:32
-
-
Save loveencounterflow/5536720 to your computer and use it in GitHub Desktop.
**testing for interaction between longjohn, coffeenode-stacktrace, q, process.on 'uncaughtException' and coa**. test 1 runs as expected; event handler is called, longjohn optionally delivers long stacktrace, so q should be fine. but in test_2 (when called as ``coffee test-stacktrace f``), although longjohn manages to deliver long stacktrace, eve…
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
# require 'coffeenode-stacktrace' | |
# require 'longjohn' | |
log = console.log | |
fs = require 'fs' | |
Q = require 'q' | |
coa = require 'coa' # https://github.com/veged/coa | |
process.on 'uncaughtException', ( error ) => | |
log '### ERROR ###' | |
test_1 = -> | |
promise = Q.nfcall fs.readFile, './package.json' | |
promise = promise.then -> Q.nfcall fs.readFile, './XXXXXX' | |
promise.done() | |
test_2 = -> | |
f = -> | |
log '### f ###' | |
d.x # `d` doesn't exist | |
cmd = coa.Cmd() | |
scmd = cmd.cmd() | |
scmd = scmd.name 'f' | |
scmd = scmd.helpful() | |
scmd = scmd.act f | |
cmd = scmd.end() | |
cmd.run process.argv.slice 2 | |
# test_1() | |
test_2() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment