Nativescript-cli: Test Runner Won't Exit

Created on 4 May 2017  路  5Comments  路  Source: NativeScript/nativescript-cli

_From @joeskeen on October 12, 2016 14:38_

tns version: 2.4.0-2016-10-06-6743
OS: OS X El Capitan 10.11.6

Running tns test ios never exits, despite the Karma configuration to only run once. This makes it impossible to run tests in continuous integration. Steps to reproduce the issue:

  • Clone the sample-Groceries repo and check out the angular-start branch
  • run tns test init
  • change line 50 of karma.conf.js from autoWatch: true, to autoWatch: false,
  • change line 75 of karma.conf.js from singleRun: false, to singleRun: true,
  • run tns test ios. The tests will run, you will see an io server disconnect log message, followed by a disregarding second execution, then it just sits there... forever.

Is there additional configuration or command line parameters needed to exit on completion? I couldn't find anything about it in the documentation, aside from using the suggestion to use the JUnit reporter and the comment in the karma.conf.js which seems to not do anything.

If this doesn't get fixed I'm going to have to resort to writing a script to launch tns test ios and kill the process as soon as the report file is written. :(

_Copied from original issue: NativeScript/nativescript-unit-test-runner#21_

unit testing

Most helpful comment

Test runner exit with --justlaunch, tested with {N} 3.0.0

All 5 comments

_From @casche on October 21, 2016 17:57_

Hey @joeskeen if you add the flag --justlaunch the test runner exits when finished.

_From @joeskeen on October 22, 2016 15:24_

Thanks, I'll try that out. Is that in the documentation any place? I don't remember coming across that.

_From @casche on October 24, 2016 17:17_

@joeskeen I found a reference to it in an old issue in the CLI repository. Not sure which one. Just tried it out and it worked!

_From @joeskeen on October 24, 2016 20:19_

Yeah, that works for me. We really should add that to the documentation, and/or the command-line --help for tns test. If I can figure out where all of that is (or if someone can point me in the right direction) I'll try to submit a PR.

Test runner exit with --justlaunch, tested with {N} 3.0.0

Was this page helpful?
0 / 5 - 0 ratings