Unverified Commit 031ed555 authored by Hugh Lilly's avatar Hugh Lilly Committed by GitHub

fix comma splice in `verifyRootLayout.ts` (#42324)

The phrase "Your page X did not have a root layout, we created Y for
you." creates a [comma
splice](https://en.wikipedia.org/wiki/Comma_splice). This PR fixes it.
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 101a70ba
...@@ -138,7 +138,7 @@ export async function verifyRootLayout({ ...@@ -138,7 +138,7 @@ export async function verifyRootLayout({
chalk.green( chalk.green(
`\nYour page ${chalk.bold( `\nYour page ${chalk.bold(
`app/${normalizedPagePath}` `app/${normalizedPagePath}`
)} did not have a root layout, we created ${chalk.bold( )} did not have a root layout. We created ${chalk.bold(
`app${rootLayoutPath.replace(appDir, '')}` `app${rootLayoutPath.replace(appDir, '')}`
)}${ )}${
!hasHead !hasHead
......
...@@ -50,7 +50,7 @@ describe('app-dir create root layout', () => { ...@@ -50,7 +50,7 @@ describe('app-dir create root layout', () => {
/did not have a root layout/ /did not have a root layout/
) )
expect(next.cliOutput.slice(outputIndex)).toMatch( expect(next.cliOutput.slice(outputIndex)).toMatch(
'Your page app/route/page.js did not have a root layout, we created app/layout.js and app/head.js for you.' 'Your page app/route/page.js did not have a root layout. We created app/layout.js and app/head.js for you.'
) )
expect(await next.readFile('app/layout.js')).toMatchInlineSnapshot(` expect(await next.readFile('app/layout.js')).toMatchInlineSnapshot(`
...@@ -112,7 +112,7 @@ describe('app-dir create root layout', () => { ...@@ -112,7 +112,7 @@ describe('app-dir create root layout', () => {
/did not have a root layout/ /did not have a root layout/
) )
expect(next.cliOutput.slice(outputIndex)).toInclude( expect(next.cliOutput.slice(outputIndex)).toInclude(
'Your page app/(group)/page.js did not have a root layout, we created app/(group)/layout.js and app/(group)/head.js for you.' 'Your page app/(group)/page.js did not have a root layout. We created app/(group)/layout.js and app/(group)/head.js for you.'
) )
expect(await next.readFile('app/(group)/layout.js')) expect(await next.readFile('app/(group)/layout.js'))
...@@ -179,7 +179,7 @@ describe('app-dir create root layout', () => { ...@@ -179,7 +179,7 @@ describe('app-dir create root layout', () => {
/did not have a root layout/ /did not have a root layout/
) )
expect(next.cliOutput.slice(outputIndex)).toInclude( expect(next.cliOutput.slice(outputIndex)).toInclude(
'Your page app/(group)/route/second/inner/page.js did not have a root layout, we created app/(group)/route/second/layout.js and app/(group)/route/second/head.js for you.' 'Your page app/(group)/route/second/inner/page.js did not have a root layout. We created app/(group)/route/second/layout.js and app/(group)/route/second/head.js for you.'
) )
expect(await next.readFile('app/(group)/route/second/layout.js')) expect(await next.readFile('app/(group)/route/second/layout.js'))
...@@ -247,7 +247,7 @@ describe('app-dir create root layout', () => { ...@@ -247,7 +247,7 @@ describe('app-dir create root layout', () => {
/did not have a root layout/ /did not have a root layout/
) )
expect(next.cliOutput.slice(outputIndex)).toInclude( expect(next.cliOutput.slice(outputIndex)).toInclude(
'Your page app/page.tsx did not have a root layout, we created app/layout.tsx and app/head.tsx for you.' 'Your page app/page.tsx did not have a root layout. We created app/layout.tsx and app/head.tsx for you.'
) )
expect(await next.readFile('app/layout.tsx')).toMatchInlineSnapshot(` expect(await next.readFile('app/layout.tsx')).toMatchInlineSnapshot(`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment