You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
categories:test: Failed to collect coverage from C:\Users\nader\Documents\devProjects\microservice-hub\apps\APIs\categories\src\index.ts
categories:test: ERROR: src/index.ts:1:20 - error TS6059: File 'C:/Users/nader/Documents/devProjects/microservice-hub/packages/node/logger/index.ts' is not under 'rootDir' 'C:/Users/nader/Documents/devProjects/microservice-hub/apps/APIs/categories/src'. 'rootDir' is expected to contain all source files.
categories:test: The file is in the program because:
categories:test: Imported via "logger" from file 'C:/Users/nader/Documents/devProjects/microservice-hub/apps/APIs/categories/src/index.ts' with packageId 'logger/[email protected]'
categories:test: Imported via "logger" from file 'C:/Users/nader/Documents/devProjects/microservice-hub/packages/node/events/producer/index.ts' with packageId 'logger/[email protected]'
categories:test: Root file specified for compilation
categories:test: Imported via "logger" from file 'C:/Users/nader/Documents/devProjects/microservice-hub/packages/node/events/producer/index.ts' with packageId 'logger/[email protected]'
categories:test:
categories:test: 1 import logger from "logger";
categories:test: ~~~~~~~~
categories:test:
categories:test: ../../../packages/node/events/producer/index.ts:9:20
categories:test: 9 import logger from "logger";
categories:test: ~~~~~~~~
categories:test: File is included via import here.
categories:test: ../../../packages/node/events/producer/index.ts:9:20
categories:test: 9 import logger from "logger";
categories:test: ~~~~~~~~
categories:test: File is included via import here.
Debug log
$ dotenv -- turbo run test --concurrency=1 --filter=categories --force
╭────────────────────────────────────────────────────────────────────────╮
│ │
│ Update available v1.9.3 ≫ v1.10.15 │
│ Changelog: https://github.com/vercel/turbo/releases/tag/v1.10.15 │
│ Run "npx @turbo/codemod update" to update │
│ │
│ Follow @turborepo for updates: https://twitter.com/turborepo │
╰────────────────────────────────────────────────────────────────────────╯
• Packages in scope: categories
• Running test in 1 packages
• Remote caching enabled
categories:test: cache bypass, force executing 9e46dfab069524bf
categories:test: $ SET TS_JEST_LOG=ts-jest.log && jest --coverage --runInBand --detectOpenHandles --forceExit --passWithNoTests
categories:test: (node:14608) [MONGOOSE] DeprecationWarning: Mongoose: the `strictQuery` option will be switched back to `false` by default in Mongoose 7. Use `mongoose.set('strictQuery', false);` if you want to prepare for this change. Or use `mongoose.set('strictQuery', true);` to suppress this warning.
categories:test: (Use `node --trace-deprecation ...` to show where the warning was created)
categories:test: PASS src/routes/category/__test__/index.test.ts (13.231 s)
categories:test: POST /category/
categories:test: validation tests
categories:test: √ should respond successfully (1) (221 ms)
categories:test: √ should throw a validation error (2) (36 ms)
categories:test: POST /category/subCategory
categories:test: validation tests
categories:test: √ should respond successfully (1) (85 ms)
categories:test: √ should throw a validation error (2) (60 ms)
categories:test: PUT /category/:id
categories:test: validation tests
categories:test: √ should respond successfully (1) (61 ms)
categories:test: √ should throw a validation error (2) (59 ms)
categories:test: DELETE /category/:id
categories:test: validation tests
categories:test: √ should respond successfully (1) (58 ms)
categories:test: GET /category/bulk
categories:test: validation tests
categories:test: √ should respond successfully (1) (22 ms)
categories:test: √ should throw a validation error (2) (27 ms)
categories:test: GET /unpaginated
categories:test: validation tests
categories:test: √ should respond successfully (1) (20 ms)
categories:test: GET /category/static-paths
categories:test: validation tests
categories:test: √ should respond successfully (1) (46 ms)
categories:test: GET /category/category-tree
categories:test: validation tests
categories:test: √ should respond successfully (1) (87 ms)
categories:test: √ should respond successfully (2) (86 ms)
categories:test: GET /category/:id
categories:test: validation tests
categories:test: √ should respond successfully (1) (51 ms)
categories:test: √ should throw a not found error (2) (30 ms)
categories:test: GET /category/
categories:test: validation tests
categories:test: √ should respond successfully (1) (21 ms)
categories:test: √ should respond successfully (2) (21 ms)
categories:test: √ should throw a validation error (3) (28 ms)
categories:test: GET /category/id-by-slug/:slug
categories:test: validation tests
categories:test: √ should respond successfully (1) (49 ms)
categories:test: GET /category/by-slug/:slug
categories:test: validation tests
categories:test: √ should respond successfully (1) (49 ms)
categories:test: not found tests
categories:test: √ should throw a Not Found Error (1) (58 ms)
categories:test:
categories:test: Failed to collect coverage from C:\Users\nader\Documents\devProjects\microservice-hub\apps\APIs\categories\src\index.ts
categories:test: ERROR: src/index.ts:1:20 - error TS6059: File 'C:/Users/nader/Documents/devProjects/microservice-hub/packages/node/logger/index.ts' is not under 'rootDir' 'C:/Users/nader/Documents/devProjects/microservice-hub/apps/APIs/categories/src'. 'rootDir' is expected to contain all source files.
categories:test: The file is in the program because:
categories:test: Imported via "logger" from file 'C:/Users/nader/Documents/devProjects/microservice-hub/apps/APIs/categories/src/index.ts' with packageId 'logger/[email protected]'
categories:test: Imported via "logger" from file 'C:/Users/nader/Documents/devProjects/microservice-hub/packages/node/events/producer/index.ts' with packageId 'logger/[email protected]'
categories:test: Root file specified for compilation
categories:test: Imported via "logger" from file 'C:/Users/nader/Documents/devProjects/microservice-hub/packages/node/events/producer/index.ts' with packageId 'logger/[email protected]'
categories:test:
categories:test: 1 import logger from "logger";
categories:test: ~~~~~~~~
categories:test:
categories:test: ../../../packages/node/events/producer/index.ts:9:20
categories:test: 9 import logger from "logger";
categories:test: ~~~~~~~~
categories:test: File is included via import here.
categories:test: ../../../packages/node/events/producer/index.ts:9:20
categories:test: 9 import logger from "logger";
categories:test: ~~~~~~~~
categories:test: File is included via import here.
categories:test: STACK:
categories:test: -------------------------------------|---------|----------|---------|---------|--------------------------
categories:test: File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
categories:test: -------------------------------------|---------|----------|---------|---------|--------------------------
categories:test: All files | 81.31 | 60.4 | 77.5 | 84.33 |
categories:test: src | 59.18 | 54.71 | 44.44 | 65.85 |
categories:test: init.testSetup.ts | 45.71 | 47.61 | 37.5 | 51.85 | 3-11,14-16,20-23
categories:test: init.ts | 92.85 | 81.81 | 100 | 92.85 | 16
categories:test: src/__test__/utils/memoryServer | 87.8 | 77.14 | 83.33 | 90.32 |
categories:test: utils.ts | 87.8 | 77.14 | 83.33 | 90.32 | 10-11,16
categories:test: src/controllers/category | 75.32 | 46.15 | 70.58 | 81.42 |
categories:test: index.ts | 75.32 | 46.15 | 70.58 | 81.42 | 3-11,14-16,20-23
categories:test: src/events | 85.71 | 85.71 | 100 | 85.71 |
categories:test: listeners.ts | 0 | 100 | 100 | 0 | 2
categories:test: producer.ts | 100 | 85.71 | 100 | 100 | 3
categories:test: src/helpers | 92.5 | 68 | 100 | 91.89 |
categories:test: getLayeredCategoriesAggregation.ts | 100 | 100 | 100 | 100 |
categories:test: getPaginationAggregation.ts | 100 | 80 | 100 | 100 | 3,17-36
categories:test: populateChildren.ts | 86.95 | 50 | 100 | 85.71 | 9,14,16
categories:test: src/models | 100 | 100 | 100 | 100 |
categories:test: Category.ts | 100 | 100 | 100 | 100 |
categories:test: src/routes | 100 | 85.71 | 100 | 100 |
categories:test: index.ts | 100 | 85.71 | 100 | 100 | 3
categories:test: src/routes/category | 55.81 | 40 | 16.66 | 63.88 |
categories:test: index.ts | 55.81 | 40 | 16.66 | 63.88 | 3-11,14-16,20-23
categories:test: src/services/category | 93.2 | 64.1 | 100 | 93.06 |
categories:test: index.ts | 93.2 | 64.1 | 100 | 93.06 | 34,39,61,110,155,174,191
categories:test: src/validators/sync/category | 84.78 | 88.88 | 90.9 | 84.78 |
categories:test: index.ts | 84.78 | 88.88 | 90.9 | 84.78 | 96-113
categories:test: -------------------------------------|---------|----------|---------|---------|--------------------------
categories:test: Test Suites: 1 passed, 1 total
categories:test: Tests: 21 passed, 21 total
categories:test: Snapshots: 0 total
categories:test: Time: 13.47 s, estimated 14 s
categories:test: Ran all test suites.
Tasks: 1 successful, 1 total
Cached: 0 cached, 1 total
Time: 21.573s
I'm running into something similar, also with a Typescript monorepo:
3 import * as T from "./SchemaTypes";
~~~~~~~~~~~~~~~
STACK:
Failed to collect coverage from /var/home/me/application/packages/types/src/SchemaTypes.ts
ERROR: src/SchemaTypes.ts:1:29 - error TS6059: File '/var/home/me/application/packages/types/src/AccessLevel.ts' is not under 'rootDir' '/var/home/me/application/src'. 'rootDir' is expected to contain all source files.
Version
29.1.0
Steps to reproduce
Have a monorepo with multiple typescript packages and nodejs apps
run testing with coverage set to true
jest config:
Expected behavior
Expected to return the complete coverage like so:
Actual behavior
receive the following error:
Debug log
ts-jest.log
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: