Skip to content

Instantly share code, notes, and snippets.

@luizamboni
Created May 9, 2020 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luizamboni/0f02a6103d177db7d9703a5cc1c24cc0 to your computer and use it in GitHub Desktop.
Save luizamboni/0f02a6103d177db7d9703a5cc1c24cc0 to your computer and use it in GitHub Desktop.
final mocha setup from strapi tutorial
const strapi = require('strapi')();
/*
* nossa nova função start
* não iniciar servidor http
* nem printa nada na tela
*/
const start = async function(cb) {
try {
await this.load();
await this.freeze();
if (cb && typeof cb === 'function') {
cb();
}
} catch (err) {
this.stopWithError(err);
}
}
strapi.start = start;
start.bind(strapi)
before((done) => {
strapi.start(() => {
done()
});
});
after(() => {
strapi.stop(0);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment