diff --git a/test/fixtures/module/modules/basic/index.js b/test/fixtures/module/modules/basic/index.js index 58e18479b4..675b661201 100755 --- a/test/fixtures/module/modules/basic/index.js +++ b/test/fixtures/module/modules/basic/index.js @@ -1,20 +1,11 @@ const path = require('path') -module.exports = function basicModule (options) { - return new Promise((resolve, reject) => { - // Add simple vendor - this.addVendor('lodash') +module.exports = function basicModule (options, resolve) { + // Add 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!') - } - }) - resolve() - }) + resolve() } diff --git a/test/fixtures/module/modules/middleware/index.js b/test/fixtures/module/modules/middleware/index.js new file mode 100755 index 0000000000..277e3aaefc --- /dev/null +++ b/test/fixtures/module/modules/middleware/index.js @@ -0,0 +1,12 @@ + +module.exports = function middlewareModule (options) { + return new Promise((resolve, reject) => { + // Add /api endpoint + this.addServerMiddleware({ + path: '/api', + handler (req, res, next) { + res.end('It works!') + } + }) + }) +} diff --git a/test/fixtures/module/nuxt.config.js b/test/fixtures/module/nuxt.config.js index 8c102b63dc..22c1332ca2 100755 --- a/test/fixtures/module/nuxt.config.js +++ b/test/fixtures/module/nuxt.config.js @@ -1,5 +1,6 @@ module.exports = { modules: [ - '~modules/basic' + '~modules/basic', + '~modules/middleware' ] }