chore(cli): fix typo (#8674)

This commit is contained in:
GeopJr 2021-01-22 11:04:46 +00:00 committed by GitHub
parent 61ed873125
commit 083505603f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ export async function serve (cmd) {
const distStat = await fs.stat(options.generate.dir).catch(err => null) // eslint-disable-line node/handle-callback-err const distStat = await fs.stat(options.generate.dir).catch(err => null) // eslint-disable-line node/handle-callback-err
const distPath = join(options.generate.dir.replace(process.cwd() + sep, ''), sep) const distPath = join(options.generate.dir.replace(process.cwd() + sep, ''), sep)
if (!distStat || !distStat.isDirectory()) { if (!distStat || !distStat.isDirectory()) {
throw new Error('Output directory `' + distPath + '` does not exists, please use `nuxt generate` before `nuxt start` for static target.') throw new Error('Output directory `' + distPath + '` does not exist, please use `nuxt generate` before `nuxt start` for static target.')
} }
const app = connect() const app = connect()
app.use(compression({ threshold: 0 })) app.use(compression({ threshold: 0 }))

View File

@ -22,7 +22,7 @@ describe('serve', () => {
test('error if dist/ does not exists', () => { test('error if dist/ does not exists', () => {
mockGetNuxtConfig({ target: TARGETS.static }) mockGetNuxtConfig({ target: TARGETS.static })
const cmd = NuxtCommand.from(serve) const cmd = NuxtCommand.from(serve)
expect(cmd.run()).rejects.toThrow(new Error('Output directory `dist/` does not exists, please use `nuxt generate` before `nuxt start` for static target.')) expect(cmd.run()).rejects.toThrow(new Error('Output directory `dist/` does not exist, please use `nuxt generate` before `nuxt start` for static target.'))
}) })
test('no error if dist/ dir exists', async () => { test('no error if dist/ dir exists', async () => {