Skip to content

Commit a4dd544

Browse files
committed
Downgrade mocha to a version before it knew about ESM...
1 parent 9e1e02c commit a4dd544

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

.mocharc.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require('jsdom-global/register');
2+
require('ts-node').register({
3+
transpileOnly: true,
4+
});
5+
6+
const mock = require('mock-require');
7+
mock('rdndmb-html5-to-touch', {});
8+
mock('react-dnd', {});
9+
mock('react-dnd-multi-backend', {});
10+
11+
module.exports = {
12+
spec: 'test/*.ts',
13+
};

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"license": "Apache-2.0",
66
"main": "lib/index.js",
77
"style": "lib/react-mosaic.css",
8+
"type": "commonjs",
89
"typings": "lib/index.d.ts",
910
"repository": {
1011
"type": "git",
@@ -32,7 +33,7 @@
3233
"prettier:run": "prettier 'styles/*.less' '*.md' '{,.}*.yml' '.circleci/*.yml'",
3334
"test": "npm-run-all build -lp test:**",
3435
"test:lint": "tslint -c tslint.yml -p tsconfig.json -e test",
35-
"test:unit": "mocha --opts test/mocha.opts 'test/*.ts'",
36+
"test:unit": "mocha",
3637
"test:format": "yarn run prettier:run --list-different",
3738
"fix": "npm-run-all -lp fix:**",
3839
"fix:format": "yarn run prettier:run --write",
@@ -75,8 +76,9 @@
7576
"less": "^3.13.1",
7677
"less-loader": "^11.1.0",
7778
"less-plugin-autoprefix": "^2.0.0",
78-
"mocha": "^7.2.0",
79+
"mocha": "^6.2.3",
7980
"mocha-junit-reporter": "^1.23.3",
81+
"mock-require": "^3.0.3",
8082
"npm-run-all": "^4.1.5",
8183
"prettier": "^2.6.1",
8284
"react": "^18.2.0",
@@ -85,7 +87,7 @@
8587
"source-map-loader": "^4.0.1",
8688
"style-loader": "^3.3.1",
8789
"ts-loader": "^9.4.2",
88-
"ts-node": "^8.10.2",
90+
"ts-node": "^10.9.1",
8991
"tslint": "^6.1.3",
9092
"tslint-config-prettier": "^1.18.0",
9193
"tslint-plugin-prettier": "^2.3.0",

test/mocha.opts

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/registerTsNode.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

tsconfig.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"forceConsistentCasingInFileNames": true,
88
"jsx": "react",
99
"lib": ["dom", "es5", "scripthost", "es2015.promise"],
10+
"moduleResolution": "node",
11+
"module": "commonjs",
1012
"noEmit": true,
1113
"noFallthroughCasesInSwitch": true,
1214
"noImplicitReturns": true,
@@ -17,9 +19,5 @@
1719
"sourceMap": true,
1820
"strict": true
1921
},
20-
"exclude": [
21-
"docs",
22-
"lib",
23-
"node_modules"
24-
]
22+
"exclude": ["docs", "lib", "node_modules"],
2523
}

0 commit comments

Comments
 (0)