Skip to content

Commit

Permalink
update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Jun 9, 2023
1 parent 0ded820 commit 49b15df
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 184 deletions.
23 changes: 11 additions & 12 deletions test/development/acceptance-app/ReactRefreshLogBox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,21 +224,20 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
"./index.js
Error:
x Unexpected token. Did you mean \`{'}'}\` or \`}\`?
,-[TEST_DIR/index.js:5:1]
5 | <p>lol</p>
6 | div
7 | )
8 | }
: ^
9 |
,-[TEST_DIR/index.js:4:1]
4 | <p>lol</p>
5 | div
6 | )
7 | }
: ^
\`----
x Unexpected eof
,-[TEST_DIR/index.js:6:1]
6 | div
7 | )
8 | }
9 |
,-[TEST_DIR/index.js:4:1]
4 | <p>lol</p>
5 | div
6 | )
7 | }
\`----
Caused by:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ exports[`ReactRefreshLogBox app default Module not found 1`] = `
"./index.js (1:0)
Module not found: Can't resolve 'b'
> 1 | import Comp from 'b'
2 | export default function Oops() {
3 | return (
4 | <div>
2 | export default function Oops() {
3 | return (
4 | <div>
https://nextjs.org/docs/messages/module-not-found
Expand All @@ -15,33 +15,31 @@ Import trace for requested module:
`;
exports[`ReactRefreshLogBox app default Module not found empty import trace 1`] = `
"./app/page.js (2:6)
"./app/page.js (2:0)
Module not found: Can't resolve 'b'
1 | 'use client'
> 2 | import Comp from 'b'
| ^
3 | export default function Oops() {
4 | return (
5 | <div>
> 2 | import Comp from 'b'
3 | export default function Oops() {
4 | return (
5 | <div>
https://nextjs.org/docs/messages/module-not-found"
`;
exports[`ReactRefreshLogBox app default Module not found missing global CSS 1`] = `
"./app/page.js:2:10
"./app/page.js:2:0
Module not found: Can't resolve './non-existent.css'
1 | 'use client'
> 2 | import './non-existent.css'
| ^
3 | export default function Page(props) {
4 | return <p>index page</p>
5 | }
> 2 | import './non-existent.css'
3 | export default function Page(props) {
4 | return <p>index page</p>
5 | }
https://nextjs.org/docs/messages/module-not-found"
`;
exports[`ReactRefreshLogBox app default Node.js builtins 1`] = `
"./node_modules/my-package/index.js (2:0)
"./node_modules/my-package/index.js (1:0)
Module not found: Can't resolve 'dns'
https://nextjs.org/docs/messages/module-not-found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ Import trace for requested module:
`;

exports[`ReactRefreshLogBox app default Should not show __webpack_exports__ when exporting anonymous arrow function 1`] = `
"index.js (4:16) @ default
2 | export default () => {
3 | if (typeof window !== 'undefined') {
> 4 | throw new Error('test')
| ^
5 | }
6 |
7 | return null"
"index.js (3:10) @ default
1 | export default () => {
2 | if (typeof window !== 'undefined') {
> 3 | throw new Error('test')
| ^
4 | }
5 |
6 | return null"
`;
exports[`ReactRefreshLogBox app default boundaries 1`] = `
Expand All @@ -41,15 +41,14 @@ exports[`ReactRefreshLogBox app default boundaries 1`] = `
`;
exports[`ReactRefreshLogBox app default conversion to class component (1) 1`] = `
"Child.js (5:18) @ ClickCount.render
3 | export default class ClickCount extends Component {
4 | render() {
> 5 | throw new Error()
| ^
6 | }
7 | }
8 | "
"Child.js (4:10) @ ClickCount.render
2 | export default class ClickCount extends Component {
3 | render() {
> 4 | throw new Error()
| ^
5 | }
6 | }"
`;
exports[`ReactRefreshLogBox app default css syntax errors 1`] = `
Expand Down Expand Up @@ -77,25 +76,25 @@ exports[`ReactRefreshLogBox app default logbox: anchors links in error messages
exports[`ReactRefreshLogBox app default logbox: anchors links in error messages 9`] = `"http://example.com/"`;
exports[`ReactRefreshLogBox app default module init error not shown 1`] = `
"index.js (4:14) @ eval
2 | // top offset for snapshot
3 | import * as React from 'react';
> 4 | throw new Error('no')
| ^
5 | class ClassDefault extends React.Component {
6 | render() {
7 | return <h1>Default Export</h1>;"
"index.js (3:6) @ eval
1 | // top offset for snapshot
2 | import * as React from 'react';
> 3 | throw new Error('no')
| ^
4 | class ClassDefault extends React.Component {
5 | render() {
6 | return <h1>Default Export</h1>;"
`;
exports[`ReactRefreshLogBox app default should strip whitespace correctly with newline 1`] = `
"index.js (9:34) @ onClick
"index.js (8:26) @ onClick
7 |
8 | <a onClick={() => {
> 9 | throw new Error('idk')
6 |
7 | <a onClick={() => {
> 8 | throw new Error('idk')
| ^
10 | }}>
11 | click me
12 | </a>"
9 | }}>
10 | click me
11 | </a>"
`;
14 changes: 7 additions & 7 deletions test/development/acceptance-app/error-recovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ describe.each(['default', 'turbo'])('Error recovery app %s', () => {

await session.waitForAndOpenRuntimeError()
expect(await session.getRedboxSource()).toMatchInlineSnapshot(`
"index.js (8:22) @ eval
"index.js (7:10) @ eval
6 | const increment = useCallback(() => {
7 | setCount(c => c + 1)
> 8 | throw new Error('oops')
5 | const increment = useCallback(() => {
6 | setCount(c => c + 1)
> 7 | throw new Error('oops')
| ^
9 | }, [setCount])
10 | return (
11 | <main>"
8 | }, [setCount])
9 | return (
10 | <main>"
`)

await session.patch(
Expand Down
39 changes: 17 additions & 22 deletions test/development/acceptance/ReactRefreshLogBox-app-doc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,24 +98,20 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => {
Error:
x Expression expected
,-[TEST_DIR/pages/_app.js:1:1]
1 |
2 | function MyApp({ Component, pageProps }) {
3 | return <<Component {...pageProps} />;
: ^
4 | }
5 | export default MyApp
6 |
1 | function MyApp({ Component, pageProps }) {
2 | return <<Component {...pageProps} />;
: ^
3 | }
4 | export default MyApp
\`----
x Expression expected
,-[TEST_DIR/pages/_app.js:1:1]
1 |
2 | function MyApp({ Component, pageProps }) {
3 | return <<Component {...pageProps} />;
: ^^^^^^^^^
4 | }
5 | export default MyApp
6 |
1 | function MyApp({ Component, pageProps }) {
2 | return <<Component {...pageProps} />;
: ^^^^^^^^^
3 | }
4 | export default MyApp
\`----
Caused by:
Expand Down Expand Up @@ -178,14 +174,13 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => {
Error:
x Unexpected token \`{\`. Expected identifier, string literal, numeric literal or [ for the computed key
,-[TEST_DIR/pages/_document.js:1:1]
1 |
2 | import Document, { Html, Head, Main, NextScript } from 'next/document'
3 |
4 | class MyDocument extends Document {{
: ^
5 | static async getInitialProps(ctx) {
6 | const initialProps = await Document.getInitialProps(ctx)
7 | return { ...initialProps }
1 | import Document, { Html, Head, Main, NextScript } from 'next/document'
2 |
3 | class MyDocument extends Document {{
: ^
4 | static async getInitialProps(ctx) {
5 | const initialProps = await Document.getInitialProps(ctx)
6 | return { ...initialProps }
\`----
Caused by:
Expand Down
23 changes: 11 additions & 12 deletions test/development/acceptance/ReactRefreshLogBox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,21 +215,20 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => {
"./index.js
Error:
x Unexpected token. Did you mean \`{'}'}\` or \`&rbrace;\`?
,-[TEST_DIR/index.js:5:1]
5 | <p>lol</p>
6 | div
7 | )
8 | }
: ^
9 |
,-[TEST_DIR/index.js:4:1]
4 | <p>lol</p>
5 | div
6 | )
7 | }
: ^
\`----
x Unexpected eof
,-[TEST_DIR/index.js:6:1]
6 | div
7 | )
8 | }
9 |
,-[TEST_DIR/index.js:4:1]
4 | <p>lol</p>
5 | div
6 | )
7 | }
\`----
Caused by:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ exports[`ReactRefreshLogBox default Module not found (empty import trace) 1`] =
"./pages/index.js:1:0
Module not found: Can't resolve 'b'
> 1 | import Comp from 'b'
2 | export default function Oops() {
3 | return (
4 | <div>
2 |
3 | export default function Oops() {
4 | return (
https://nextjs.org/docs/messages/module-not-found"
`;
exports[`ReactRefreshLogBox default Module not found (missing global CSS) 1`] = `
"./pages/_app.js:2:8
"./pages/_app.js:1:0
Module not found: Can't resolve './non-existent.css'
1 |
> 2 | import './non-existent.css'
| ^
3 |
4 | export default function App({ Component, pageProps }) {
5 | return <Component {...pageProps} />
> 1 | import './non-existent.css'
2 |
3 | export default function App({ Component, pageProps }) {
4 | return <Component {...pageProps} />
https://nextjs.org/docs/messages/module-not-found"
`;
Expand All @@ -28,9 +26,9 @@ exports[`ReactRefreshLogBox default Module not found 1`] = `
"./index.js:1:0
Module not found: Can't resolve 'b'
> 1 | import Comp from 'b'
2 | export default function Oops() {
3 | return (
4 | <div>
2 |
3 | export default function Oops() {
4 | return (
https://nextjs.org/docs/messages/module-not-found
Expand All @@ -39,7 +37,7 @@ Import trace for requested module:
`;
exports[`ReactRefreshLogBox default Node.js builtins 1`] = `
"./node_modules/my-package/index.js:2:0
"./node_modules/my-package/index.js:1:0
Module not found: Can't resolve 'dns'
https://nextjs.org/docs/messages/module-not-found
Expand Down
Loading

0 comments on commit 49b15df

Please sign in to comment.