-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load env with a validation schema to safeguard and type
- Loading branch information
1 parent
15fd8ba
commit bea8819
Showing
14 changed files
with
280 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,38 @@ | ||
const MAP_ALIASES = { | ||
'^@src(.*)$': "<rootDir>/src$1", | ||
'^@shared/(.*)$': '<rootDir>/../shared/$1', | ||
"^@src(.*)$": "<rootDir>/src/$1", | ||
"^@test/(.*)$": "<rootDir>/test/$1", | ||
"^@shared/(.*)$": "<rootDir>/../shared/$1" | ||
}; | ||
const MAP_TO_SAME_SEQUELIZE_PACKAGE = { | ||
'^sequelize(.*)$': '<rootDir>/node_modules/sequelize$1', | ||
} | ||
"^sequelize(.*)$": "<rootDir>/node_modules/sequelize$1" | ||
}; | ||
|
||
const common = { | ||
transform: { | ||
'^.+\\.(t|j)s$': ['ts-jest', { tsconfig: './tsconfig.json' }], | ||
"^.+\\.(t|j)s$": ["ts-jest", { tsconfig: "./tsconfig.json" }] | ||
}, | ||
rootDir: '.', | ||
rootDir: ".", | ||
moduleNameMapper: { | ||
...MAP_ALIASES, | ||
...MAP_TO_SAME_SEQUELIZE_PACKAGE, | ||
...MAP_TO_SAME_SEQUELIZE_PACKAGE | ||
}, | ||
setupFiles: ['./test/setup.ts'], | ||
setupFiles: ["./test/setup.ts"] | ||
}; | ||
|
||
module.exports = { | ||
collectCoverageFrom: ['./src/**/*.{js,ts}'], | ||
collectCoverageFrom: ["./src/**/*.{js,ts}"], | ||
projects: [ | ||
{ | ||
displayName: 'unit', | ||
displayName: "unit", | ||
...common, | ||
testMatch: ['<rootDir>/src/**/*.spec.ts'], | ||
setupFilesAfterEnv: ['./test/setup-unit-tests.ts'], | ||
testMatch: ["<rootDir>/src/**/*.spec.ts"], | ||
setupFilesAfterEnv: ["./test/setup-unit-tests.ts"] | ||
}, | ||
{ | ||
displayName: 'functional', | ||
displayName: "functional", | ||
...common, | ||
testMatch: ['<rootDir>/test/functional/**/*.spec.ts'], | ||
setupFilesAfterEnv: ['./test/setup-functional-tests.ts'], | ||
}, | ||
], | ||
testMatch: ["<rootDir>/test/functional/**/*.spec.ts"], | ||
setupFilesAfterEnv: ["./test/setup-functional-tests.ts"] | ||
} | ||
] | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.