Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run test fails with-jest-app using --watch flag. #69236

Open
1 task done
pgibler opened this issue Aug 23, 2024 · 1 comment
Open
1 task done

npm run test fails with-jest-app using --watch flag. #69236

pgibler opened this issue Aug 23, 2024 · 1 comment
Labels
examples Issue/PR related to examples

Comments

@pgibler
Copy link

pgibler commented Aug 23, 2024

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2
  Available memory (MB): 64156
  Available CPU cores: 32
Binaries:
  Node: 20.9.0
  npm: 10.2.4
  Yarn: 1.22.22
  pnpm: 9.8.0
Relevant Packages:
  next: 14.2.6 // Latest available version is detected (14.2.6).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.3.3
Next.js Config:
  output: N/A

Which example does this report relate to?

with-jest-app

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

The default with-jest-app example fails to run the tests and produces an error with no message. Example:

Determining test suites to run...

  ● Test suite failed to run

thrown: [Error]

I changed package.json to use a different test command. The default is as follows:

"scripts": {
  "test": "jest --watch",
},

I changed it to two alternative configurations, both which ran the tests successfully:

"scripts": {
  "test": "jest",
},
"scripts": {
  "test": "jest --watchAll",
},

The example should work out of the box, so either the error should be figured out so --watch works, or --watchAll should be used, or the flag should be removed.

Expected Behavior

npm run test

> test
> jest

 PASS  __tests__/index.test.tsx
 PASS  __tests__/snapshot.tsx
 PASS  app/counter.test.tsx
 PASS  app/page.test.tsx
 PASS  app/blog/[slug]/page.test.tsx
 PASS  app/utils/add.test.ts

Test Suites: 6 passed, 6 total
Tests:       6 passed, 6 total
Snapshots:   1 passed, 1 total
Time:        0.924 s, estimated 1 s
Ran all test suites.

To Reproduce

Clone the with-jest-app example project and run npm run test

@pgibler pgibler added the examples Issue/PR related to examples label Aug 23, 2024
@IshimweJoliePrincesse
Copy link

http://localhost:3000

✓ Starting...
⚠ Disabling SWC Minifer will not be an option in the next major version. Please report any issues you may be experiencing to https://github.com/vercel/next.js/issues
⚠ Attempted to load @next/swc-win32-ia32-msvc, but an error occurred: A dynamic link library (DLL) initialization routine failed.
\?\C:\Users\user\OneDrive\Desktop\isomo-blog-app\node_modules@next\swc-win32-ia32-msvc\next-swc.win32-ia32-msvc.node
⨯ Failed to load SWC binary for win32/ia32, see more info here: https://nextjs.org/docs/messages/failed-loading-swc

PS C:\Users\user\OneDrive\Desktop\isomo-blog-app>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Issue/PR related to examples
Projects
None yet
Development

No branches or pull requests

2 participants