Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .depcheckrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignores": ["@types/node", "@commitlint/cli", "husky", "ts-node", "@types/readable-stream", "@types/jest", "ts-jest"]
"ignores": ["@types/node", "@commitlint/cli", "husky", "ts-node", "@types/readable-stream", "@types/jest", "ts-jest", "babel-plugin-add-import-extension"]
}
File renamed without changes.
File renamed without changes.
20 changes: 16 additions & 4 deletions jest.config.ts → jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/en/configuration.html
*/
import type { Config } from '@jest/types'

export default async (): Promise<Config.InitialOptions> => {
export default async () => {
return {
preset: 'ts-jest',
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',

// Indicates whether the coverage information should be collected while executing the test
// collectCoverage: false,

// This will setup the prerequisites for the tests to run
globalSetup: './tests-setup.ts',
globalSetup: './jest/postage-setup.js',

// The directory where Jest should output its coverage files
coverageDirectory: 'coverage',
Expand All @@ -29,5 +28,18 @@ export default async (): Promise<Config.InitialOptions> => {

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: ['/node_modules/'],

extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
'^.+\\.m?[tj]sx?$': [
'ts-jest',
{
useESM: true,
},
],
},
}
}
4 changes: 2 additions & 2 deletions nodemon.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"ignore": [".git", "node_modules/", "dist/", "coverage/"],
"watch": ["src/"],
"execMap": {
"ts": "node -r ts-node/register"
"ts": "ts-node-esm --experimentalSpecifierResolution=node"
},
"env": {
"NODE_ENV": "development"
},
"ext": "js,json,ts"
"ext": "js,json,ts,mjs"
}
Loading