mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
[tests] use promise
This commit is contained in:
parent
632a94a9c6
commit
58842f3c03
25
test/fixtures/module/modules/basic/index.js
vendored
25
test/fixtures/module/modules/basic/index.js
vendored
@ -1,17 +1,20 @@
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
module.exports = async function basicModule (options) {
|
module.exports = function basicModule (options) {
|
||||||
// Add simple vendor
|
return new Promise((resolve,reject) => {
|
||||||
this.addVendor('lodash')
|
// Add simple vendor
|
||||||
|
this.addVendor('lodash')
|
||||||
|
|
||||||
// Add a plugin
|
// Add a plugin
|
||||||
this.addPlugin(path.resolve(__dirname, 'reverse.js'))
|
this.addPlugin(path.resolve(__dirname, 'reverse.js'))
|
||||||
|
|
||||||
// Add simple api endpoint
|
// Add simple api endpoint
|
||||||
this.addServerMiddleware({
|
this.addServerMiddleware({
|
||||||
path: '/api',
|
path: '/api',
|
||||||
handler (req, res, next) {
|
handler (req, res, next) {
|
||||||
res.end('It works!')
|
res.end('It works!')
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
resolve()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user