Created
May 9, 2020 21:01
-
-
Save luizamboni/0f02a6103d177db7d9703a5cc1c24cc0 to your computer and use it in GitHub Desktop.
final mocha setup from strapi tutorial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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