react-code-dataset / next.js /test /development /app-dir /serialize-circular-error /serialize-circular-error.test.ts
Download next.js/test/development/app-dir/serialize-circular-error/serialize-circular-error.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.5 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/app-dir/serialize-circular-error/serialize-circular-error.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/development/app-dir/serialize-circular-error/serialize-circular-error.test.ts
-
curl -L -o serialize-circular-error.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/app-dir/serialize-circular-error/serialize-circular-error.test.ts
1.5 kB
| import { nextTestSetup } from 'e2e-utils' | |
| describe('serialize-circular-error', () => { | |
| const { next } = nextTestSetup({ | |
| files: __dirname, | |
| }) | |
| it('should serialize the object from server component in console correctly', async () => { | |
| const browser = await next.browser('/') | |
| await expect(browser).toDisplayRedbox(` | |
| { | |
| "description": "An error occurred but serializing the error message failed.", | |
| "environmentLabel": "Server", | |
| "label": "Runtime Error", | |
| "source": null, | |
| "stack": [], | |
| } | |
| `) | |
| const output = next.cliOutput | |
| expect(output).toContain( | |
| 'Error: {"objA":{"other":{"a":"[Circular]"}},"objB":"[Circular]"}' | |
| ) | |
| }) | |
| it('should serialize the object from client component in console correctly', async () => { | |
| const browser = await next.browser('/client') | |
| // TODO: Format arbitrary messages in Redbox | |
| await expect(browser).toDisplayRedbox(` | |
| { | |
| "description": "[object Object]", | |
| "environmentLabel": null, | |
| "label": "Runtime Error", | |
| "source": null, | |
| "stack": [], | |
| } | |
| `) | |
| const bodyText = await browser.elementByCss('body').text() | |
| expect(bodyText).toContain( | |
| 'Application error: a client-side exception has occurred while loading localhost (see the browser console for more information).' | |
| ) | |
| const output = next.cliOutput | |
| expect(output).toContain( | |
| 'Error: {"objC":{"other":{"a":"[Circular]"}},"objD":"[Circular]"}' | |
| ) | |
| }) | |
| }) | |