mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-18 03:35:17 +00:00
232bc0196f
## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (a non-breaking change which fixes an issue) - [x] New feature (a non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Description Resolves #3920 by adding a warning during the build process and a small disclaimer into the default page component. ## Checklist: - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. (PR: #) - [x] I have added tests to cover my changes (if not applicable, please state why) - [x] All new and existing tests are passing.
18 lines
550 B
JavaScript
18 lines
550 B
JavaScript
import consola from 'consola'
|
|
import { buildFixture } from '../../utils/build'
|
|
|
|
describe('missing-pages-dir', () => {
|
|
buildFixture('missing-pages-dir', (builder) => {
|
|
const options = builder.nuxt.options
|
|
expect(consola.warn).toHaveBeenCalledTimes(1)
|
|
expect(consola.warn.mock.calls).toMatchObject([
|
|
[{
|
|
message: `No \`${options.dir.pages}\` directory found in ${options.srcDir}.`,
|
|
additional: 'Using the default built-in page.\n',
|
|
additionalStyle: 'yellowBright',
|
|
badge: true
|
|
}]
|
|
])
|
|
})
|
|
})
|