[tests] use promise

This commit is contained in:
Pooya Parsa 2017-05-15 03:10:09 +04:30
parent 632a94a9c6
commit 58842f3c03

View File

@ -1,17 +1,20 @@
const path = require('path')
module.exports = async function basicModule (options) {
// Add simple vendor
this.addVendor('lodash')
module.exports = function basicModule (options) {
return new Promise((resolve,reject) => {
// Add simple vendor
this.addVendor('lodash')
// Add a plugin
this.addPlugin(path.resolve(__dirname, 'reverse.js'))
// Add a plugin
this.addPlugin(path.resolve(__dirname, 'reverse.js'))
// Add simple api endpoint
this.addServerMiddleware({
path: '/api',
handler (req, res, next) {
res.end('It works!')
}
// Add simple api endpoint
this.addServerMiddleware({
path: '/api',
handler (req, res, next) {
res.end('It works!')
}
})
resolve()
})
}