busterjs / buster

Abandoned - A powerful suite of automated test tools for JavaScript.
http://docs.busterjs.org
Other
448 stars 37 forks source link

buster.assert.exception() is broken. #389

Closed ghost closed 10 years ago

ghost commented 10 years ago

Example taken from http://docs.busterjs.org/en/latest/modules/buster-assertions/#exception

Reproduction:

mkdir referee-bug
cd referee-bug

$~/referee-bug>  node -v
v0.10.21

$~/referee-bug>  npm show buster version | grep -v npm
0.7.8

$~/referee-bug>  npm show referee version | grep -v npm
1.0.1

$~/referee-bug>  ps a | grep buster
2630 pts/0    Sl     0:17 node /usr/bin/buster-server

$~/referee-bug> netstat -tlpen | grep "1111\|Proto"                                                                                            
Proto Recv-Q Send-Q Local Address  Foreign Address  State   User  Inode  PID/Program name    
tcp        0      0 0.0.0.0:1111   0.0.0.0:*        LISTEN  1000  35391  2630/node  

$~/referee-bug>  echo 'module.exports[""] = { environment: "browser", tests: [ "issue-test.js" ] };' > buster.js                     
$~/referee-bug>  echo 'buster.testCase("Issue", { "Must fail": function() { buster.assert.exception( function () { throw new Error("Aww"); }, "TypeError" ); }});' > issue-test.js

$~/referee-bug>  buster-test -v
Running tests: 
Creating browser session
-> Firefox 25.0 on Linux 64-bit
-> Chrome 33.0.1707.0 on Linux 64-bit
2 tests, 2 assertions, 2 runtimes ... OK
Successfully closed session

Instead of failing, the test passes.

regards dtg

dwittner commented 10 years ago

Duplicate to issue #387.