NativeScript / nativescript-cli

Command-line interface for building NativeScript apps
https://www.npmjs.com/package/nativescript
Apache License 2.0
1.04k stars 195 forks source link

Running tns test android does not detect tests and is stuck in `test: loading; ` #5607

Open ZachPerkitny opened 2 years ago

ZachPerkitny commented 2 years ago

Environment

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.

alexist commented 2 years ago

Maybe related to https://github.com/NativeScript/nativescript-cli/issues/4182

antischematic commented 2 years ago

Also experiencing this issue, same env except using mocha instead of jasmine.

antischematic commented 2 years ago

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.