blitz-js / legacy-framework

MIT License
2 stars 2 forks source link

Tests do not run out of the box #998

Open ekawatani opened 1 year ago

ekawatani commented 1 year ago

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

> booking@1.0.0 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