onnxruntime/js/package.json
Yulong Wang 53c771f215
[js/common] add unit tests for onnxruntime-common (#16812)
### Description
"onnxruntime-common" starts to get more and more complicated, so it's a
good idea to add unit tests for it.

Includes the following changes:
- move `mocha` from each subfolder (js/web/, js/node/) to root (js/), so
that it will be installed once and all subfolder can use.
- add folder `test` in js/common/ as root folder for ort-common tests.
- add sub folder `type-tests`. this folder contains a few typescript
source code, which are excluded from the tsconfig.json. they are not
compiled by default. instead, file `type-tests.ts` calls typescript
compiler (tsc) to check for the files under this folder whether the
compilation result is as expected. If tsc compiles a file successfully
when a failure is expected, this is considered an failed test.
- add sub folder `unit-tests`. files under this folder will be compiled
by default. we use default mode of mocha (using `describe()` and `it()`)
to setup test groups and cases.
- update eslint rules accordingly.
2023-07-25 14:37:41 -07:00

38 lines
1.3 KiB
JSON

{
"devDependencies": {
"@types/fs-extra": "^11.0.1",
"@types/mocha": "^10.0.1",
"@types/node": "^18.14.6",
"@types/npmlog": "^4.1.4",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"clang-format": "^1.8.0",
"dir-compare": "^4.0.0",
"eslint": "^8.35.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsdoc": "^40.0.1",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-unicorn": "^46.0.0",
"fs-extra": "^11.1.0",
"jszip": "^3.10.1",
"mocha": "^10.2.0",
"node-polyfill-webpack-plugin": "^2.0.1",
"npmlog": "^7.0.1",
"terser": "^5.16.5",
"ts-loader": "^9.4.2",
"typescript": "^4.9.5",
"webpack": "^5.76.0",
"webpack-bundle-analyzer": "^4.8.0",
"webpack-cli": "^5.0.1",
"worker-loader": "^3.0.8"
},
"scripts": {
"prepare": "tsc --build scripts",
"lint": "eslint . --ext .ts --ext .tsx",
"format": "clang-format --glob=\"{scripts/**/*.ts,common/lib/**/*.ts,node/{lib,script,test}/**/*.ts,node/src/**/*.{cc,h},web/{lib,script,test}/**/*.ts,react_native/{android,example,ios,lib}/**/*.{ts,mm,java}}\" --style=file -i",
"prepare-node-tests": "node ./scripts/prepare-onnx-node-tests",
"update-version": "node ./scripts/update-version"
},
"license": "MIT"
}