Skip to content

Commit b51978d

Browse files
committed
Update jest config
1 parent b41fa36 commit b51978d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

course-matrix/backend/jest.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ const config: Config = {
66
// to obtain access to the matchers.
77
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
88
modulePaths: ["<rootDir>"],
9+
modulePathIgnorePatterns: [
10+
"<rootDir>/test/__fixtures__",
11+
"<rootDir>/node_modules",
12+
"<rootDir>/dist",
13+
"<rootDir>/__test__",
14+
],
915
testEnvironment: "node",
1016
transform: {
1117
"^.+\\.(ts|tsx)$": [

course-matrix/backend/src/middleware/errorHandler.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export const errorHandler: ErrorRequestHandler = (err, req, res, next) => {
5050

5151
if (process.env.NODE_ENV === "development") {
5252
console.error(err);
53+
} else {
54+
if (process.env.NODE_ENV === "test") {
55+
console.error(err);
56+
}
5357
}
5458

5559
res.status(statusCode).json(response);

0 commit comments

Comments
 (0)