mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-04 04:07:22 +00:00
[js/common] a few fixes/revises to onnxruntime-common (#16853)
### Description - enable unit test for js/common in CI - add debug config in js/.vscode/launch.json - enable source map for js/common/test for debugging purposes; add source map files to ignore list - ignore js/common/test folder for npm packaging
This commit is contained in:
parent
c4e4b98fb2
commit
969c95f73f
7 changed files with 52 additions and 5 deletions
38
js/.vscode/launch.json
vendored
38
js/.vscode/launch.json
vendored
|
|
@ -5,9 +5,43 @@
|
|||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "[common] Launch Unit Tests",
|
||||
"args": [
|
||||
"-u",
|
||||
"bdd",
|
||||
"--timeout",
|
||||
"999999",
|
||||
"--colors",
|
||||
"${workspaceFolder}/common/test/**/*.js"
|
||||
],
|
||||
"internalConsoleOptions": "openOnSessionStart",
|
||||
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
|
||||
"cwd": "${workspaceFolder}/common",
|
||||
"request": "launch",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "node",
|
||||
"sourceMaps": true,
|
||||
"preLaunchTask": "tsc: build - common/test/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"name": "[web] Launch Test Runner",
|
||||
"program": "${workspaceFolder}/web/script/test-runner-cli.js",
|
||||
"request": "launch",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "node",
|
||||
"cwd": "${workspaceFolder}/web",
|
||||
"args": [
|
||||
"suite1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "[web] Attach to Chrome",
|
||||
"type": "chrome",
|
||||
"request": "attach",
|
||||
"name": "Attach to Chrome",
|
||||
"port": 9333,
|
||||
"webRoot": "${workspaceFolder}",
|
||||
"sourceMapPathOverrides": {
|
||||
|
|
@ -18,7 +52,7 @@
|
|||
"smartStep": true
|
||||
},
|
||||
{
|
||||
"name": "Remote Browser via Webkit Adaptor",
|
||||
"name": "[web] Remote Browser via Webkit Adaptor",
|
||||
"type": "chrome",
|
||||
"request": "attach",
|
||||
"port": 9000,
|
||||
|
|
|
|||
1
js/common/.gitignore
vendored
1
js/common/.gitignore
vendored
|
|
@ -3,5 +3,6 @@ dist/
|
|||
docs/
|
||||
|
||||
/test/**/*.js
|
||||
/test/**/*.js.map
|
||||
|
||||
tsconfig.tsbuildinfo
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ typedoc.json
|
|||
tsconfig.json
|
||||
**/*.tsbuildinfo
|
||||
|
||||
/test/
|
||||
|
||||
*.tgz
|
||||
|
|
|
|||
|
|
@ -13,8 +13,9 @@
|
|||
"build:esm": "tsc",
|
||||
"build:bundles": "webpack",
|
||||
"build": "node ./build.js",
|
||||
"prepare": "npm run build && tsc -p test",
|
||||
"test": "mocha ./test/**/*.js"
|
||||
"prepare": "npm run build",
|
||||
"pretest": "tsc --build ./test",
|
||||
"test": "mocha ./test/**/*.js --timeout 30000"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typedoc": "^0.23.22"
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
"extends": "../../tsconfig.tools.json",
|
||||
"exclude": ["type-tests/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"module": "ES2022"
|
||||
"module": "ES2022",
|
||||
"sourceMap": true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,6 +94,10 @@ jobs:
|
|||
npm ci
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js/common'
|
||||
displayName: 'npm ci /js/common/'
|
||||
- script: |
|
||||
npm test
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js/common'
|
||||
displayName: 'run onnxruntime-common tests'
|
||||
- script: |
|
||||
npm ci
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js/web'
|
||||
|
|
|
|||
|
|
@ -102,6 +102,10 @@ jobs:
|
|||
npm ci
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js\common'
|
||||
displayName: 'npm ci /js/common/'
|
||||
- script: |
|
||||
npm test
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js\common'
|
||||
displayName: 'run onnxruntime-common tests'
|
||||
- script: |
|
||||
npm ci
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js\web'
|
||||
|
|
|
|||
Loading…
Reference in a new issue