From 58842f3c03abf033458a4aafc921f66f01495c1b Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 15 May 2017 03:10:09 +0430 Subject: [PATCH] [tests] use promise --- test/fixtures/module/modules/basic/index.js | 25 ++++++++++++--------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/test/fixtures/module/modules/basic/index.js b/test/fixtures/module/modules/basic/index.js index fb9243d0ed..941bc81884 100755 --- a/test/fixtures/module/modules/basic/index.js +++ b/test/fixtures/module/modules/basic/index.js @@ -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() }) }