Support to setup nativescript unit test mocha,chai,karma on android emulator


#1

I am setting up test environment for writing unit test cases using karma, mocha, chai.
When we try to run basic test cases i see a nativescript crash.
I am attaching following things

  1. Karma.conf file - karma configuration for mocha and chai to run on android emulator.
  2. Package.json - Application dependencies
  3. app/tests/setup.js - Initialisation of testbed
  4. app/tests/components/home.service.spec.ts - same test case
  5. crashCallStack - Details about the stack

Please help me to setup the test environment in proper way.


#2

Anyone please help to fix this.
Did i want to give more information regarding this?


#3

Hey @Arvinth, I’d advise starting with sharing a repository/relevant code to your problem. The screenshots aren’t really helpful, considering those can’t be debugged.

Thanks!


#4

Hi @Pete.K ,

I have uploaded the code in the below gitlab repo.

Please check it,


#5

Can anyone please help me to resolve this issue.

I have uploaded my sample project git link above.


#6

I’ve the same problem here: