by Rachnerd | v0.0.3
Workaround for NativeScript to run unit tests located in source code (Angular style guide)
npm i --save @rachnerd/test-plugin
  • Version: 0.0.3
  • GitHub:
  • Downloads:
    • Last Day:   0
    • Last Week:  0
    • Last Month: 6

NativeScript tests hook

Workaround for running unit tests located in source code (according to Angular style guide)

Currently NativeScript runs spec files located in app/tests. This hook copies all source code (in app) to a .tmp folder inside app/tests, so NativeScript can run unit tests that follow the Angular style guide.


|-- feature
|- feature.component.html
|- feature.component.ts
|- feature.component.spec.ts



npm install nativescript-tests-hook --save-dev


Unfortunately the test runner fetches the files before the hook is finished. To get around this you'll have to prepare before executing the test command.

tns prepare [platform] && tns test [platform]