Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tns test android launches the app instead of running the tests #4571

Closed
yringler opened this issue Apr 29, 2019 · 8 comments
Closed

tns test android launches the app instead of running the tests #4571

yringler opened this issue Apr 29, 2019 · 8 comments
Labels

Comments

@yringler
Copy link

Environment
Using angular.

  • CLI: 5.3.4
  • Cross-platform modules (tns-core-modules): 5.3.1
  • Android Runtime: 5.3.1
  • Plugin(s): nativescript-audio, nativescript-download-progress

Describe the bug
Unit tests aren't run.
Using angular.
tns test android --bundle runs the app. It does not run unit tests.

To Reproduce
git clone https://github.com/yringler/rabbi-gordon-audio
git checkout 15-unit-test
tns test android --bundle

Expected behavior
Unit tests are run

Sample project
https://github.com/yringler/rabbi-gordon-audio/tree/15-unit-test

@Fatme
Copy link
Contributor

Fatme commented Apr 29, 2019

@yringler,

You need to update your nativescript-dev-webpack plugin and webpack.config.js file.

rm -rf webpack.config.js
npm i nativescript-dev-webpack@latest --save-dev

After that you can initialize the tests and run them.

tns test init
tns test android --bundle

@Fatme Fatme added the question label Apr 29, 2019
@yringler
Copy link
Author

Thank you.
That gets me up to #3146.
Closing this, as that issue is already there.

@Fatme
Copy link
Contributor

Fatme commented Apr 29, 2019

@yringler,

The workaround for #3146 is rm -rf platforms before tns test command.

@yringler
Copy link
Author

No luck.
I had already tried git clean -xdf.
Tried rm -rf platforms then test, but same error: first "disconnected", then "no reachable hosts"

@Fatme
Copy link
Contributor

Fatme commented May 2, 2019

@yringler,

Can you please ensure that you passed --bundle option to the command?

If this is not the case, you need to ensure that the device and your computer are in the same network. This is a requirement in order to run unit tests on a connected device.

@yringler
Copy link
Author

yringler commented May 2, 2019

They were indeed on a different network; PC on wifi, and phone on data.
I'll take a look.

@yringler
Copy link
Author

yringler commented May 2, 2019

Although as per #4574, it seems that the new webpack (which is needed for unit tests) breaks uglify, so I don't know if I'd want it on my main branch yet.
However, I'll try again (using the same network) on my unit test branch when I have a chance, and I'll keep you posted.
Ty.

@Nileshdcool
Copy link

I am also facing some issues while running the test cases. They get executed and suddenly mobile application on which test results are being displayed gets shut down.
Error What I get is disconnectedClient disconnected from CONNECTED state (transport error)

I neither able to see my test cases on mobile neither on browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants