Skip to content

Commit

Permalink
feat(core): Finish jest setting leftovers (squash)
Browse files Browse the repository at this point in the history
-Add jsdom  as a testEnvironment to run client code in browser setting instead of node
- Resolve moduleNameMapper complie failures for absolute imports with @ sign for jest to compile properly
- Add watch mode command to the pckge.json scripts list
- Fix all broken tests and mock DIs
  • Loading branch information
Walid Bouguima committed Feb 11, 2024
1 parent d854878 commit 2ed23d1
Show file tree
Hide file tree
Showing 11 changed files with 6,006 additions and 10,598 deletions.
12 changes: 12 additions & 0 deletions src/EcommerceDDD.Spa/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@

module.exports = {
preset: 'jest-preset-angular',
moduleDirectories: [ "node_modules", "src"],

setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
testEnvironment: "jsdom",
moduleNameMapper: {
"@core/(.*)": "<rootDir>/src/app/core/$1",
"@ecommerce/(.*)": "<rootDir>/src/app/modules/ecommerce/$1",
"@authentication/(.*)": "<rootDir>/src/app/modules/authentication/$1",
"@shared/(.*)": "<rootDir>/src/app/shared/$1",
"@environments/(.*)": "<rootDir>/src/environments/$1"
},
coveragePathIgnorePatterns: ["/models","/constants", "/environments"]
};
Loading

0 comments on commit 2ed23d1

Please sign in to comment.