@jasongrout here is my approach to get the karma tests to work.
I haven't rebased it due to time restrictions, but this PR applied to the version before yesterday lead to the following outcome:
$ jlpm test:chrome
yarn run v1.21.1
$ karma start --browsers=Chrome tests/karma.conf.js
START:
17 04 2020 14:19:54.867:INFO [compiler.karma-typescript]: Compiling project using Typescript 3.7.5
17 04 2020 14:19:58.290:INFO [compiler.karma-typescript]: Compiled 2 files in 3388 ms.
17 04 2020 14:20:13.455:INFO [bundler.karma-typescript]: Bundled imports for 6 file(s) in 14662 ms.
17 04 2020 14:20:13.663:INFO [karma-server]: Karma v4.4.1 server started at http://0.0.0.0:9876/
17 04 2020 14:20:13.664:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
17 04 2020 14:20:13.672:INFO [launcher]: Starting browser Chrome
17 04 2020 14:20:18.327:INFO [Chrome 80.0.3987 (Mac OS X 10.14.6)]: Connected on socket Vo4TK9tx9Q_Fh5qlAAAA with id 59295966
Sidecar
SidecarModel
✖ should be createable
✖ should be createable with a value
Finished in 0.043 secs / 0 secs @ 14:20:19 GMT+0200 (GMT+02:00)
SUMMARY:
✔ 0 tests completed
✖ 2 tests failed
FAILED TESTS:
Sidecar
SidecarModel
17 04 2020 14:20:19.478:WARN [reporter]: SourceMap position not found for trace: at SidecarModel.initialize (base/src/widget.js?61103a732e53ec236c6426e01399c25f38578cd9:5:1146)
17 04 2020 14:20:19.479:WARN [reporter]: SourceMap position not found for trace: at new SidecarModel (base/src/widget.js?61103a732e53ec236c6426e01399c25f38578cd9:5:465)
✖ should be createable
Chrome 80.0.3987 (Mac OS X 10.14.6)
TypeError: Cannot read property 'sessionContext' of undefined
at SidecarModel.initialize (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:138171:35)
at SidecarModel.initialize (src/widget.js:5:1146)
at SidecarModel.Backbone.Model (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:18445:21)
at SidecarModel.WidgetModel [as constructor] (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:130766:38)
at SidecarModel.DOMWidgetModel [as constructor] (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:131312:38)
at new OutputModel (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:33514:38)
at SidecarModel.<anonymous> (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:138121:204)
at SidecarModel.OutputModel (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:138142:19)
at new SidecarModel (src/widget.js:5:465)
at Object.createTestModel (tests/src/utils.spec.ts:112:10 <- tests/src/utils.spec.js:112:12)
17 04 2020 14:20:19.490:WARN [reporter]: SourceMap position not found for trace: at SidecarModel.initialize (base/src/widget.js?61103a732e53ec236c6426e01399c25f38578cd9:5:1146)
17 04 2020 14:20:19.490:WARN [reporter]: SourceMap position not found for trace: at new SidecarModel (base/src/widget.js?61103a732e53ec236c6426e01399c25f38578cd9:5:465)
✖ should be createable with a value
Chrome 80.0.3987 (Mac OS X 10.14.6)
TypeError: Cannot read property 'sessionContext' of undefined
at SidecarModel.initialize (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:138171:35)
at SidecarModel.initialize (src/widget.js:5:1146)
at SidecarModel.Backbone.Model (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:18445:21)
at SidecarModel.WidgetModel [as constructor] (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:130766:38)
at SidecarModel.DOMWidgetModel [as constructor] (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:131312:38)
at new OutputModel (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:33514:38)
at SidecarModel.<anonymous> (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:138121:204)
at SidecarModel.OutputModel (/var/folders/n5/9s5nr_8n79b7w2ly9n2cqcvh0000gn/T/karma-typescript-bundle-81037RM69i2D2XP2C.js:138142:19)
at new SidecarModel (src/widget.js:5:465)
at Object.createTestModel (tests/src/utils.spec.ts:112:10 <- tests/src/utils.spec.js:112:12)
=============================== Coverage summary ===============================
Statements : 56.6% ( 30/53 )
Branches : 0% ( 0/4 )
Functions : 33.33% ( 3/9 )
Lines : 56.86% ( 29/51 )
================================================================================
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
(sidecar) bernhard@Turing:jupyterlab-sidecar [jl2]$ git pull
Bereits aktuell.
@jasongrout here is my approach to get the karma tests to work. I haven't rebased it due to time restrictions, but this PR applied to the version before yesterday lead to the following outcome: