Nativescript-cli: build-*-bundle gets stuck at nativescript-unit-test-runner hook in NS 3.2

Created on 18 Oct 2017  路  8Comments  路  Source: NativeScript/nativescript-cli

Tell us about the problem

The commands npm run build-android-bundle and npm run build-ios-bundle get stuck at the nativescript-unit-test-runner hook and never fail or complete in NS 3.2:

npm run build-ios-bundle

> @ build-ios-bundle /Users/davidbenninger/Desktop/Test
> npm run ns-bundle --ios --build-app


> @ ns-bundle /Users/davidbenninger/Desktop/Test
> ns-bundle

Running tns prepare...
Executing before-prepare hook from /Users/davidbenninger/Desktop/Test/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Project successfully prepared (ios)
Executing after-prepare hook from /Users/davidbenninger/Desktop/Test/hooks/after-prepare/nativescript-unit-test-runner.js

a normal tns run ... seems to work fine.

Which platform(s) does your issue occur on?

with iOS and Android

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.2.1
  • Cross-platform modules: 3.2.0
  • Runtime(s): 3.2.0
  • Plugin(s): "nativescript-unit-test-runner": "^0.3.4"

To reproduce:

  1. tns create Test --template ng
  2. cd Test
  3. npm install --save-dev nativescript-dev-webpack
  4. npm install
  5. tns test init -> select "jasmine"
  6. npm run build-android-bundle
bug unit testing

All 8 comments

@dbenninger thank you for reporting this issue - confirming this as a bug.
Steps to reproduce: use the ones described in the thread above!

@NickIliev this blocks us from upgrading. Any news on this?

@dbenninger we are currently looking into it but meanwhile as the plugin nativescript-unit-test-runner is used mainly in development, perhaps you can remove the plugin (and the hooks) before bundling with WebPack (temporary solution)

Contact me at the community slack (user: niki_iliev, slack: nativescriptcommunity) so we could discuss another workflow.

Anyone can post the concrete "workaround" here, maybe with code examples?

@renestalder Our workaround is to remove the unit test plugin before running the bundle build:

tns plugin remove nativescript-unit-test-runner

Thank you. :)

I'm not that used to the whole tns cli possibilities yet.

@renestalder I've just been deleting the file at hooks/after-prepare/nativescript-unit-test-runner.js and then reverting the changes with git once I'm done using bundling.

Hey all, a fix is available in CLI's next version (npm i -g nativescript@next), can you please give it a try and see if it resolves the issue on your side?
Also we plan to release the fix in a 3.3.1 version of NativeScript CLI.

Was this page helpful?
0 / 5 - 0 ratings