Created
October 25, 2021 01:18
-
-
Save jordaaash/2a0c3c360aa700cc9528e89620e82c3d to your computer and use it in GitHub Desktop.
Mocha + TypeScript + ESM
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
{ | |
"extension": ["ts"], | |
"node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm"], | |
"spec": ["test/**/*.test.ts"] | |
} |
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
{ | |
"type": "module", | |
"sideEffects": false, | |
"scripts": { | |
"test": "mocha" | |
}, | |
"devDependencies": { | |
"@types/chai-as-promised": "^7.1.4", | |
"@types/mocha": "^9.0.0", | |
"@types/node": "^16.9.1", | |
"chai": "^4.3.4", | |
"chai-as-promised": "^7.1.1", | |
"mocha": "^9.1.3", | |
"ts-node": "^10.3.0", | |
"tslib": "^2.3.0", | |
"typescript": "^4.4.3" | |
} | |
} |
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
{ | |
"compilerOptions": { | |
"outDir": "lib", | |
"noEmit": false, | |
"declaration": true, | |
"sourceMap": true, | |
"noEmitOnError": true, | |
"stripInternal": true, | |
"target": "es6", | |
"module": "esnext", | |
"moduleResolution": "node", | |
"strict": true, | |
"esModuleInterop": true, | |
"resolveJsonModule": true, | |
"isolatedModules": true, | |
"typeRoots": ["node_modules/@types", "types"] | |
}, | |
"include": ["src", "types", "test"], | |
"exclude": ["node_modules"] | |
} |
Watch mode is broken with this configuration but adding --parallel
seems to fix the problem.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any way to also add path aliases resolution? (resolving paths defined within tsconfig.json>paths)