Skip to content

Commit cd0ad63

Browse files
authored
Mocha version update (#1131)
* update mocha and introduce esm test project * update ci step * remove run ci
1 parent 420a446 commit cd0ad63

File tree

10 files changed

+2877
-2061
lines changed

10 files changed

+2877
-2061
lines changed

.github/workflows/ci_validation.yml

+7
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,10 @@ jobs:
3232

3333
- name: Run unit tests
3434
run: npm test
35+
36+
- name: Verify ESM compatibility
37+
if: matrix.node-version == '16.x'
38+
working-directory: './test-esm'
39+
run: |
40+
npm ci
41+
npm test

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ test/development/secrets.ts
3030

3131
.idea/*
3232

33-
testResult.xml
33+
testResult.xml
34+
35+
test-esm/lib/*

.npmignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ src/
22
scripts/
33
design/
44
changelogs/
5-
testResult.xml
5+
testResult.xml
6+
test-esm/

package-lock.json

+861-2,048
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-11
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@
4848
"prepack": "npm install && npm run build && npm run test",
4949
"pre-build": "npm run setVersion",
5050
"setVersion": "gulp setVersion",
51-
"test": "npm run test:cjs && npm run test:esm",
51+
"test": "npm run test:cjs && npm run karma",
5252
"test:cjs": "npm run build:sub_cjs && mocha",
5353
"test:coverage": "TS_NODE_PROJECT='./tsconfig-cjs.json' nyc mocha --require isomorphic-fetch -r ts-node/register test/common/**/*.ts && mocha --require isomorphic-fetch -r ts-node/register test/common/**/*.ts",
54-
"test:development": "tsc --p test/tsconfig-test-development.json && mocha 'lib/test/development/**/*.js' --require isomorphic-fetch",
55-
"test:esm": "npm run build:sub_es && mocha --require esm"
54+
"test:development": "tsc --p test/tsconfig-test-development.json && mocha 'lib/test/development/**/*.js' --require isomorphic-fetch"
5655
},
5756
"mocha": {
5857
"reporter": [
@@ -63,13 +62,10 @@
6362
},
6463
"spec": [
6564
"lib/test/common/**/*.js",
66-
"lib/test/node/**/*.js",
67-
"lib/es/test/common/**/*.js",
68-
"lib/es/test/node/**/*.js"
65+
"lib/test/node/**/*.js"
6966
],
7067
"require": [
71-
"isomorphic-fetch",
72-
"esm"
68+
"isomorphic-fetch"
7369
]
7470
},
7571
"nyc": {
@@ -101,7 +97,7 @@
10197
"@rollup/plugin-node-resolve": "^15.0.0",
10298
"@rollup/plugin-terser": "^0.3.0",
10399
"@types/chai": "^4.2.14",
104-
"@types/mocha": "^9.0.0",
100+
"@types/mocha": "^10.0.1",
105101
"@types/node": "^18.0.0",
106102
"@types/sinon": "^10.0.8",
107103
"@typescript-eslint/eslint-plugin": "^5.12.1",
@@ -111,7 +107,6 @@
111107
"eslint-config-prettier": "^8.3.0",
112108
"eslint-plugin-prettier": "^4.0.0",
113109
"eslint-plugin-simple-import-sort": "^8.0.0",
114-
"esm": "^3.2.25",
115110
"form-data": "^4.0.0",
116111
"gulp": "^4.0.2",
117112
"husky": "^8.0.0",
@@ -123,7 +118,7 @@
123118
"karma-mocha": "^2.0.1",
124119
"karma-typescript": "^5.2.0",
125120
"lint-staged": "^13.0.0",
126-
"mocha": "^6.2.3",
121+
"mocha": "^10.2.0",
127122
"mocha-junit-reporter": "^2.1.1",
128123
"nyc": "^15.1.0",
129124
"prettier": "^2.5.1",

test-esm/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The test-esm project verifies if the Graph JS Client compiles with ESM projects successfully.

0 commit comments

Comments
 (0)