Skip to content

Instantly share code, notes, and snippets.

@lennym
Created July 1, 2015 12:04
Show Gist options
  • Save lennym/6fd6dc4e0e47c75a8c13 to your computer and use it in GitHub Desktop.
Save lennym/6fd6dc4e0e47c75a8c13 to your computer and use it in GitHub Desktop.
mocha async setup example
var getApp = require('./main');
describe('App Tests', function () {
var app;
beforeEach(function (done) {
getApp(function (err, a) {
app = a;
done(err);
})
});
it('now has access to app', function () {
app.should.be.ok;
});
});
@anabellaspinelli
Copy link

As simple as this is, it really helped me get the concept and apply it. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment