Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught exception logic is faulty. #58

Open
sam-falvo opened this issue Jun 10, 2013 · 2 comments
Open

Uncaught exception logic is faulty. #58

sam-falvo opened this issue Jun 10, 2013 · 2 comments

Comments

@sam-falvo
Copy link
Contributor

While attempting to add a means of signalling an exception generated outside the context of a test to Whiskey, I happened upon another bug with respect to exceptions within the context of a test.

To reproduce:

  1. Edit lib/common.js and insert this text on line 425: throw { message: 'hello world' };
  2. Invoke Whiskey (see results below for how I invoked it).

Apparently, the _testObj member of the TestFile class is not being initialized.

$ NODE_PATH=$(pwd)/lib-cov bin/whiskey --coverage --coverage-reporter cli --coverage-file /tmp/hooey --coverage-dir /tmp -t example/test-bdd.js                                                                                                                                                                   /Users/sfalvo/git/whiskey :: Mon Jun 10 15:32:34 PDT 2013
path.existsSync is now called `fs.existsSync`.
/Users/sfalvo/git/whiskey/example/test-bdd.js

Stderr:

/Users/sfalvo/git/whiskey/lib/common.js:553
    test._testObj.finish();
                  ^
TypeError: Cannot call method 'finish' of null
    at TestFile.addUncaughtException (/Users/sfalvo/git/whiskey/lib/common.js:553:19)
    at process.<anonymous> (/Users/sfalvo/git/whiskey/lib/run_test_file.js:116:12)
    at process.EventEmitter.emit (events.js:95:17)
    at process._fatalException (node.js:272:26)
@Kami
Copy link
Member

Kami commented Jun 10, 2013

@sam-falvo Can you please provide a link to the line in a file where this happens / patch which reproduces this?

Also, judging by the exception this doesn't seem to happen in the context of a test, although I might be wrong.

@sam-falvo
Copy link
Contributor Author

See #59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants