typescript-express-mongoose-starter icon indicating copy to clipboard operation
typescript-express-mongoose-starter copied to clipboard

Title: Absolute path doesn't work with test files

Open EngenMe opened this issue 1 year ago • 0 comments
trafficstars

Description

When using absolute paths in test files, such as:

import AuthRoute from '@routes/auth.route';

The test file shows error because the absolute path is not recognized. This is likely due to the exclusion of the src/tests folder in the tsconfig.json configuration.

image

Suggested Solution:

To fix this issue, simply modify the tsconfig.json file to exclude the tests directory instead of src/tests.

Change this line in tsconfig.json:

"exclude": ["node_modules", "src/http", "src/logs", "src/tests"]

To:

"exclude": ["node_modules", "src/http", "src/logs"]

EngenMe avatar Oct 18 '24 10:10 EngenMe