Skip to content

Uncaught exception logic is faulty. #58

Open
@sam-falvo

Description

@sam-falvo

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions