force mocha to behave synchronously

1,305 views
Skip to first unread message

Tomas Neme

unread,
Apr 18, 2013, 12:03:37 PM4/18/13
to moc...@googlegroups.com
I have problems with tests interfering with each other, I use a MLT
service and I have (async) tests that open and close it and tests that
that works OK, while I have other (also async) tests that try to send
commands to the same process.

Is there any way to make sure mocha waits for each test' done() call
before it goes on to the next?

--
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

vision media [ Tj Holowaychuk ]

unread,
Apr 18, 2013, 12:10:33 PM4/18/13
to moc...@googlegroups.com
That's the only way mocha behaves, maybe you're missing a done() callback? it should always wait



--
You received this message because you are subscribed to the Google Groups "Mocha" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mochajs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Tomas Neme

unread,
Apr 18, 2013, 12:21:50 PM4/18/13
to moc...@googlegroups.com
> That's the only way mocha behaves, maybe you're missing a done() callback?
> it should always wait

On where?

On outer describe()s?

my tests are usually like this:

describe(File stuff, function() {
describe(Function stuff, function() {
it(--- test specific, function(done) {})
it(--- test specific, function(done) {})
})
describe(some other function, function() {})
})

I don't think I'm missing any dones within any it's, before's or after's

Tomas Neme

unread,
Apr 18, 2013, 12:22:28 PM4/18/13
to moc...@googlegroups.com
Maybe I should make sure of calling delete on any instances I'm using
for testing
Reply all
Reply to author
Forward
0 new messages