Skip to content

Commit

Permalink
cros-ide: Show TS filepaths in unit tests stacktrace
Browse files Browse the repository at this point in the history
Using source-map-support, we can make stacktrace from Jasmine unit tests
print Typescript filepaths.
I found this in jasmine/jasmine#491 (comment) .

BUG=b:230048048
TEST=manually let a test fail and checked the stacktrace

Change-Id: Icf6cbba3049576df8b04e96ab79aaa09502cdbea
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/3934909
Tested-by: Keigo Oka <oka@chromium.org>
Reviewed-by: Tomasz Tylenda <ttylenda@chromium.org>
Commit-Queue: Keigo Oka <oka@chromium.org>
  • Loading branch information
Keigo Oka authored and Chromeos LUCI committed Oct 11, 2022
1 parent f2f1c05 commit b601733
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
13 changes: 4 additions & 9 deletions ide_tooling/cros-ide/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion ide_tooling/cros-ide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@
"build-tests": "rm -rf out && tsc -p . --outDir out",
"build-all": "npm run build && npm run build-tests",
"test": "npm run unit-test && npm run integration-test",
"unit-test": "npm run build-tests && NODE_PATH=out/test/unit/injected_modules jasmine --config=src/test/unit/jasmine.json",
"unit-test": "npm run build-tests && NODE_PATH=out/test/unit/injected_modules NODE_OPTIONS='-r source-map-support/register' jasmine --config=src/test/unit/jasmine.json",
"integration-test": "npm run build-all && rm -rf .vscode-test/user-data && xvfb-run -a node ./out/test/integration/runTest.js",
"manual-test:cpp_xrefs": "NODE_PATH=out/test/unit/injected_modules npx ts-node ./src/test/manual/cpp_xrefs/main.ts",
"lint": "npm run lint-code && npm run lint-license",
Expand All @@ -650,6 +650,7 @@
"glob": "^7.1.7",
"js-base64": "^3.7.2",
"semver": "^7.3.7",
"source-map-support": "^0.5.21",
"uuid": "^8.3.2",
"ws": "^8.6.0"
},
Expand Down

0 comments on commit b601733

Please sign in to comment.