nativescript-cli
nativescript-cli copied to clipboard
Running tns test android does not detect tests and is stuck in `test: loading; `
Environment
- CLI: 8.1.4
- karma: 6.3.7
- karma-jasmine: 4.0.1
- karma-webpack: 5.0.0
- karma-nativescript-launcher: ~2.9.0
Describe the bug
I initalized tests using tns test init
using jasmine. After running tns test android
, in the browser the header shows test: loading
and it doesn't appear to load any test files in the network tab. The mobile app that's launched on my emulator shows no tests. I did not make any modifications to the version of the dependencies or to the generated karma.conf.js
. There were no errors in the logs.
To Reproduce
Run tns test init
and select jasmine
Run tns test android
, it launches the app with no tests displayed. In the browser, it displays test:loading
Expected behavior My unit tests to be displayed and their status.
Maybe related to https://github.com/NativeScript/nativescript-cli/issues/4182
Also experiencing this issue, same env except using mocha instead of jasmine.
I found the cause of this problem for me was running the test under a network proxy, which prevented the context.json files from loading. Disabling the proxy fixed the error. Upgrading to unit-test-runner 3.0.4 revealed the context.json error in the console.