visionmedia / expresso

use mocha
http://visionmedia.github.com/expresso
759 stars 89 forks source link

Fail to late or async export tests #125

Open flockonus opened 13 years ago

flockonus commented 13 years ago

Please, check my [https://gist.github.com/1152521],

Explaining.. i have some tests that should be ran without authentication var unauth_tests, total of 5 exports. And afterwards, I want 1 authed.

I export the first batch, unauth_tests, line 154 After the last one of these runs, inside the callback (line 141), I set cookie, and append the authed tests , only one, line 183, which don't run. I also make a setTimeout, line 160, much like the one in the docs, but it also fails.

My output is:

fps@piolho:~/workspace/dbserver$ cd ~/workspace/dbserver/; expresso -s
Express server listening on port 8011 in development mode
.RUN 1
.RUN 2
.RUN 3
.RUN 4
.RUN 5
appending getUsers

But expected:

fps@piolho:~/workspace/dbserver$ cd ~/workspace/dbserver/; expresso -s
Express server listening on port 8011 in development mode
.RUN 1
.RUN 2
.RUN 3
.RUN 4
.RUN 5
appending getUsers
.RUN 7
.RUN 6

Is my logic wrong?