-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
You can replicate by pulling my repo and uncommenting the commented-out test.
Test Source
it('probable exits for throws on non-state', t => t.throws(() => {
const machine = new jssm.machine({
initial_state: '1',
transitions:[
{ name:'id1', from:'1', to:'2', action:'identical' }
]
});
// why does this test fail Threw unexpected exception: 'No such state "3" in probable_exits_for' >:(
machine.probable_exits_for('3');
}, Error));
Error Message & Stack Trace
general › Illegal machines probable exits for throws on non-state
/Users/johnhaugeland/projects/jssm/src/js/tests/general.js:780
779:
780: it('probable exits for throws on non-state', t => t.throws(() => {
781:
Threw unexpected exception:
'No such state "3" in probable_exits_for'
The exception is expected, and that is the correct exception message.
This test is a .throws()
. I don't understand why this is treated as a failure. Near-verbatim identical tests cover my other throw
s and work as expected.
Config
I do not configure Ava. No such block or .rc exists in my project.
Command-Line Arguments
"test": "ava src/js/tests/*.js",
Relevant Links
Environment
Replicates under MacOS current and Windows 10 Pro current. Both tested under node 8 current.
Replicates on travis-ci under node-6, node-7, and node-8, all current, all under whatever linux they use.
All are using ava 0.20.0, installed as local node modules.
Metadata
Metadata
Assignees
Labels
No labels