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

Tests do not run out of the box #998

Open
ekawatani opened this issue Dec 28, 2022 · 0 comments
Open

Tests do not run out of the box #998

ekawatani opened this issue Dec 28, 2022 · 0 comments

Comments

@ekawatani
Copy link

What is the problem?

When I run npm run test, it throws an error even if I have not modified anything. I'm running this on Windows 11 64-bit.

Paste all your error logs here:

PS C:\Users\eigok\projects\booking> npm run test

> [email protected] test
> vitest run --passWithNoTests

Loaded env from C:\Users\eigok\projects\booking\.env.test
Loaded env from C:\Users\eigok\projects\booking\.env

 RUN  v0.25.3 C:/Users/eigok/projects/booking

 ❯ src/auth/mutations/forgotPassword.test.ts (2)
   ❯ forgotPassword mutation (2)
     × does not throw error if user doesn't exist
       \ [ beforeEach ]
     × works correctly
       \ [ beforeEach ]
 ❯ src/auth/mutations/resetPassword.test.ts (1)
   ❯ resetPassword mutation (1)
     × works correctly
       - [ beforeEach ]
 ↓ test/index.test.tsx (1) [skipped]

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 3 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
 FAIL  src/auth/mutations/forgotPassword.test.ts > forgotPassword mutation > does not throw error if user doesn't exist
 FAIL  src/auth/mutations/forgotPassword.test.ts > forgotPassword mutation > works correctly
Error: not found: prisma
 ❯ getNotFoundError node_modules/npm-which/node_modules/which/which.js:13:12
 ❯ Function.whichSync [as sync] node_modules/npm-which/node_modules/which/which.js:134:9
 ❯ Function.npmWhich.sync node_modules/npm-which/index.js:52:26
 ❯ Proxy.<anonymous> node_modules/blitz/dist/index-browser.cjs:146:61
 ❯ node_modules/blitz/dist/index-browser.cjs:127:61
 ❯ __async$2 node_modules/blitz/dist/index-browser.cjs:111:10
 ❯ Proxy.reset node_modules/blitz/dist/index-browser.cjs:140:18
 ❯ src/auth/mutations/forgotPassword.test.ts:9:12
      7|
      8| beforeEach(async () => {
      9|   await db.$reset()
       |            ^
     10| })
     11|

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: {
  "code": "ENOENT",
}


⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯

 FAIL  src/auth/mutations/resetPassword.test.ts > resetPassword mutation > works correctly
Error: not found: prisma
 ❯ getNotFoundError node_modules/npm-which/node_modules/which/which.js:13:12
 ❯ Function.whichSync [as sync] node_modules/npm-which/node_modules/which/which.js:134:9
 ❯ Function.npmWhich.sync node_modules/npm-which/index.js:52:26
 ❯ Proxy.<anonymous> node_modules/blitz/dist/index-browser.cjs:146:61
 ❯ node_modules/blitz/dist/index-browser.cjs:127:61
 ❯ __async$2 node_modules/blitz/dist/index-browser.cjs:111:10
 ❯ Proxy.reset node_modules/blitz/dist/index-browser.cjs:140:18
 ❯ src/auth/mutations/resetPassword.test.ts:7:12
      5|
      6| beforeEach(async () => {
      7|   await db.$reset()
       |            ^
      8| })
      9|

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: {
  "code": "ENOENT",
}


⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/3]⎯

 Test Files  2 failed | 1 skipped (3)
      Tests  3 failed | 1 skipped (4)
   Start at  15:32:38
   Duration  11.05s (transform 1.55s, setup 5.91s, collect 11.48s, tests 49ms)

Paste all relevant code snippets here:

N/A

What are detailed steps to reproduce this?

  1. Create a new blitz project using blitz new my-app. (Selected TypeScript, full, React Final Form)
  2. cd my-app
  3. npm run build
  4. npm run test

Run blitz -v and paste the output here:

Blitz version: 2.0.0-beta.20 (global)
Blitz version: 2.0.0-beta.20 (local)
Windows 11 | win32-x64 | Node: v17.9.1


 Package manager: npm

  System:
    OS: Windows 10 10.0.22621
    CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
    Memory: 19.26 GB / 31.59 GB
  Binaries:
    Node: 17.9.1 - ~\scoop\apps\nvm\current\nodejs\nodejs\node.EXE
    Yarn: Not Found
    npm: 8.11.0 - ~\scoop\apps\nvm\current\nodejs\nodejs\npm.CMD
  npmPackages:
    @blitzjs/auth: 2.0.0-beta.20 => 2.0.0-beta.20
    @blitzjs/next: 2.0.0-beta.20 => 2.0.0-beta.20
    @blitzjs/rpc: 2.0.0-beta.20 => 2.0.0-beta.20
    @prisma/client: 4.6.0 => 4.6.0
    blitz: 2.0.0-beta.20 => 2.0.0-beta.20
    next: 12.2.5 => 12.2.5
    prisma: 4.6.0 => 4.6.0
    react: 18.2.0 => 18.2.0
    react-dom: 18.2.0 => 18.2.0
    typescript: ^4.8.4 => 4.9.4

Please include below any other applicable logs and screenshots that show your problem:

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant