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

[Typegoose] npm run test fail #188

Open
ghost opened this issue Oct 31, 2022 · 3 comments
Open

[Typegoose] npm run test fail #188

ghost opened this issue Oct 31, 2022 · 3 comments
Assignees
Labels
🐞 Bug Something isn't working

Comments

@ghost
Copy link

ghost commented Oct 31, 2022

Describe the Bug (버그 설명)

On a new generation, running
npm run test fails
Also noticed that the test command doesnt set the env to "test" so i changed it to "test": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles",

Version to Reproduce (현재 사용한 버전)

9.2.0

Steps to Reproduce (재현 순서)

Generate new typegoose template, run npm run test

Expected Behavior (예상 동작)

Test passed

Actual Behavior (실제 동작)

 FAIL  src/tests/users.test.ts
  ● Test suite failed to run

    src/tests/users.test.ts:16:60 - error TS2339: Property 'users' does not exist on type 'UserService'.

    16       const users = usersRoute.usersController.userService.users;
                                                                  ~~~~~
    src/tests/users.test.ts:47:60 - error TS2339: Property 'users' does not exist on type 'UserService'.

    47       const users = usersRoute.usersController.userService.users;
                                                                  ~~~~~
    src/tests/users.test.ts:69:60 - error TS2339: Property 'users' does not exist on type 'UserService'.

    69       const users = usersRoute.usersController.userService.users;
                                                                  ~~~~~
    src/tests/users.test.ts:93:60 - error TS2339: Property 'users' does not exist on type 'UserService'.

    93       const users = usersRoute.usersController.userService.users;
                                                                  ~~~~~
    src/tests/users.test.ts:120:60 - error TS2339: Property 'users' does not exist on type 'UserService'.

    120       const users = usersRoute.usersController.userService.users;
Test Suites: 2 failed, 1 passed, 3 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        3.87 s, estimated 4 s
Ran all test suites.

@ghost ghost added the 🐞 Bug Something isn't working label Oct 31, 2022
@ghost ghost assigned ljlm0402 Oct 31, 2022
@ghost ghost changed the title [Typegoose] npm run test and npm run dev crash [Typegoose] npm run test fail Oct 31, 2022
@itsmee3223
Copy link

did you fix it? because i face the same issue when run the test

@ghost
Copy link
Author

ghost commented Sep 2, 2023

Sorry I didn't fix it.

@itsmee3223
Copy link

so what you do...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants