Files
vuepress/packages/@vuepress/test-utils/prepare.js
T
ULIVZ f81f3732f6 feat: refine theme API
1. Support scope package and shortcut like plugin.
2. Support relative path for 'layout' and 'notFound' option.
2018-09-02 22:55:44 +08:00

18 lines
579 B
JavaScript

const { fs, logger } = require('@vuepress/shared-utils')
const prepare = require('@vuepress/core/lib/prepare')
const { docsModes } = require('./meta')
async function prepareForTest () {
await Promise.all(docsModes.map(async ({ docsPath, docsTempPath }) => {
await fs.ensureDir(docsTempPath)
await prepare(docsPath, { theme: '@vuepress/default', temp: docsTempPath })
}))
}
module.exports = function globalSetup () {
logger.wait('Start preparing for testing ...')
return prepareForTest().then(() => {
logger.wait('Finished preparing for testing ...')
})
}