Skip to content

Commit

Permalink
fix: updated snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
wyattjoh committed May 24, 2023
1 parent f84a7b2 commit f741043
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 36 deletions.
Expand Up @@ -75,7 +75,7 @@ exports[`ReactRefreshLogBox default unterminated JSX 1`] = `
"./index.js
Error:
x Unexpected token. Did you mean \`{'}'}\` or \`}\`?
,-[/private/var/folders/jm/n3311p411n5341x4p1wfj7z80000gn/T/next-install-9e08dcb77e83d8d025ff6e2e8a8f40604d37e8afcc1974643ce3e43cfbcf2833/index.js:5:1]
,-[5:1]
5 | <p>lol</p>
6 | div
7 | )
Expand All @@ -85,7 +85,7 @@ Error:
\`----
x Unexpected eof
,-[/private/var/folders/jm/n3311p411n5341x4p1wfj7z80000gn/T/next-install-9e08dcb77e83d8d025ff6e2e8a8f40604d37e8afcc1974643ce3e43cfbcf2833/index.js:6:1]
,-[6:1]
6 | div
7 | )
8 | }
Expand Down
4 changes: 2 additions & 2 deletions test/development/basic/__snapshots__/hmr.test.ts.snap
Expand Up @@ -4,7 +4,7 @@ exports[`basic HMR, basePath: "" Error Recovery should recover after loader pars
"./components/parse-error.js
Error:
x Expression expected
,-[./components/parse-error.js:1:1]
,-[1:1]
1 | This
2 | is
3 | }}}
Expand All @@ -18,7 +18,7 @@ exports[`basic HMR, basePath: "/docs" Error Recovery should recover after loader
"./components/parse-error.js
Error:
x Expression expected
,-[./components/parse-error.js:1:1]
,-[1:1]
1 | This
2 | is
3 | }}}
Expand Down
66 changes: 34 additions & 32 deletions test/development/basic/hmr.test.ts
Expand Up @@ -595,13 +595,13 @@ describe.each([[''], ['/docs']])(

expect(await hasRedbox(browser, true)).toBe(true)
expect(await getRedboxHeader(browser)).toMatchInlineSnapshot(`
" 1 of 1 unhandled error
Server Error
" 1 of 1 unhandled error
Server Error
Error: The default export is not a React Component in page: \\"/hmr/about5\\"
Error: The default export is not a React Component in page: \\"/hmr/about5\\"
This error happened while generating the page. Any console logs will be displayed in the terminal window."
`)
This error happened while generating the page. Any console logs will be displayed in the terminal window."
`)

await next.patchFile(aboutPage, aboutContent)

Expand Down Expand Up @@ -698,13 +698,13 @@ describe.each([[''], ['/docs']])(

expect(await hasRedbox(browser, true)).toBe(true)
expect(await getRedboxHeader(browser)).toMatchInlineSnapshot(`
" 1 of 1 unhandled error
Server Error
" 1 of 1 unhandled error
Server Error
Error: The default export is not a React Component in page: \\"/hmr/about7\\"
Error: The default export is not a React Component in page: \\"/hmr/about7\\"
This error happened while generating the page. Any console logs will be displayed in the terminal window."
`)
This error happened while generating the page. Any console logs will be displayed in the terminal window."
`)

await next.patchFile(aboutPage, aboutContent)

Expand Down Expand Up @@ -756,19 +756,19 @@ describe.each([[''], ['/docs']])(
`"Failed to compile"`
)
expect(await getRedboxSource(browser)).toMatchInlineSnapshot(`
"./components/parse-error.xyz
Module parse failed: Unexpected token (3:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| This
| is
> }}}
| invalid
| js
Import trace for requested module:
./components/parse-error.xyz
./pages/hmr/about8.js"
`)
"./components/parse-error.xyz
Module parse failed: Unexpected token (3:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| This
| is
> }}}
| invalid
| js
Import trace for requested module:
./components/parse-error.xyz
./pages/hmr/about8.js"
`)

await next.patchFile(aboutPage, aboutContent)

Expand Down Expand Up @@ -864,11 +864,13 @@ describe.each([[''], ['/docs']])(

expect(await hasRedbox(browser, true)).toBe(true)
expect(await getRedboxHeader(browser)).toMatchInlineSnapshot(`
" 1 of 1 unhandled error
Unhandled Runtime Error
" 1 of 1 unhandled error
Server Error
Error: an-expected-error-in-gip"
`)
Error: an-expected-error-in-gip
This error happened while generating the page. Any console logs will be displayed in the terminal window."
`)

await next.patchFile(
erroredPage,
Expand Down Expand Up @@ -908,13 +910,13 @@ describe.each([[''], ['/docs']])(

expect(await hasRedbox(browser, true)).toBe(true)
expect(await getRedboxHeader(browser)).toMatchInlineSnapshot(`
" 1 of 1 unhandled error
Server Error
" 1 of 1 unhandled error
Server Error
Error: an-expected-error-in-gip
Error: an-expected-error-in-gip
This error happened while generating the page. Any console logs will be displayed in the terminal window."
`)
This error happened while generating the page. Any console logs will be displayed in the terminal window."
`)

const erroredPage = join('pages', 'hmr', 'error-in-gip.js')

Expand Down

0 comments on commit f741043

Please sign in to comment.