Is there a methodology to test (potential) interleaving of asynchronous functions with vows?
For example:
// Topic portion
var user = new User('jacob')
user.set('email,'foo@bar.com')
user.save() // a
user.set('email',derp@cherp.com')
user.save() // b
user.refresh(this.callback) // Reload from database
// Callback
assert.equals(user.email,'derp@cherp.com')
There is could be a race condition between the two saves. When writing my tests I want to ensure that my API is ensuring that b finishes last (and that we have the correct final value for the email). With the way that's it written, the test will pass coincidentally some of the time.