react-code-dataset / next.js /test /development /app-dir /build-error-logs /build-error-logs.test.ts
Download next.js/test/development/app-dir/build-error-logs/build-error-logs.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 711 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/app-dir/build-error-logs/build-error-logs.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/development/app-dir/build-error-logs/build-error-logs.test.ts
-
curl -L -o build-error-logs.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/app-dir/build-error-logs/build-error-logs.test.ts
711 Bytes
| import { nextTestSetup } from 'e2e-utils' | |
| import stripAnsi from 'strip-ansi' | |
| describe('build-error-logs', () => { | |
| const { next, isTurbopack } = nextTestSetup({ | |
| files: __dirname, | |
| }) | |
| it('should only log error a single time', async () => { | |
| await next.fetch('/') | |
| const output = stripAnsi(next.cliOutput) | |
| expect(output).toContain('Module not found') | |
| const moduleNotFoundLogs = output | |
| .split('\n') | |
| .filter((line) => line.includes('Module not found')) | |
| if (isTurbopack) { | |
| expect(moduleNotFoundLogs).toHaveLength(1) | |
| } else { | |
| // FIXME: next with webpack still logs the same error too many times | |
| expect(moduleNotFoundLogs).toHaveLength(3) | |
| } | |
| }) | |
| }) | |