mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
## Logging Improvements * Delay server start logging Post start logging after request handler is created, so when error occurred like missing "app" or "pages" directory it won't log start server message, instead it will only show error message. * Fix jsconfig hmr case Previously the `jsconfig.json` is patched too early that didn't trigger the hmr reload, this PR enables it to show on the * Adding timestamp for "ready" event Display a timesmap after "ready" message, so we can monitor how long does it take, and keep perfing on it * Polish logging format * Starts with captital letter * align the indentation 
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
/* eslint-env jest */
|
|
import { createNextDescribe } from 'e2e-utils'
|
|
import { check } from 'next-test-utils'
|
|
|
|
createNextDescribe(
|
|
'Deprecated @next/font warning',
|
|
{
|
|
files: {
|
|
'pages/index.js': '',
|
|
},
|
|
dependencies: {
|
|
react: 'latest',
|
|
'react-dom': 'latest',
|
|
'@next/font': 'canary',
|
|
},
|
|
skipStart: true,
|
|
},
|
|
({ next }) => {
|
|
it('should warn if @next/font is in deps', async () => {
|
|
await next.start()
|
|
await check(() => next.cliOutput, /ready/i)
|
|
await check(
|
|
() => next.cliOutput,
|
|
new RegExp('please use the built-in `next/font` instead')
|
|
)
|
|
|
|
await next.stop()
|
|
await next.clean()
|
|
})
|
|
|
|
it('should not warn if @next/font is not in deps', async () => {
|
|
// Remove @next/font from deps
|
|
const packageJson = JSON.parse(await next.readFile('package.json'))
|
|
delete packageJson.dependencies['@next/font']
|
|
await next.patchFile('package.json', JSON.stringify(packageJson))
|
|
|
|
await next.start()
|
|
await check(() => next.cliOutput, /ready/i)
|
|
expect(next.cliOutput).not.toInclude(
|
|
'please use the built-in `next/font` instead'
|
|
)
|
|
|
|
await next.stop()
|
|
await next.clean()
|
|
})
|
|
}
|
|
)
|