Use CommonJS tsconfig for testing

This commit is contained in:
Dolan Miu
2021-09-30 15:27:19 +01:00
parent 0df72996b5
commit f602a097d2
2 changed files with 8 additions and 1 deletions

View File

@ -5,7 +5,7 @@
"main": "build/index.js", "main": "build/index.js",
"scripts": { "scripts": {
"pretest": "rimraf ./build", "pretest": "rimraf ./build",
"test": "mocha -r ts-node/register -r tsconfig-paths/register \"src/**/*.ts\"", "test": "TS_NODE_PROJECT=\"tsconfig.spec.json\" mocha -r ts-node/register -r tsconfig-paths/register \"src/**/*.ts\"",
"test.coverage": "nyc npm test", "test.coverage": "nyc npm test",
"test.watch": "npm test -- --watch", "test.watch": "npm test -- --watch",
"prepublishOnly": "npm run build --production", "prepublishOnly": "npm run build --production",

7
tsconfig.spec.json Normal file
View File

@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6"
}
}