NativeScript unit test problems
While my first NativeScript app is having some progress I wanted to have some tests for it. So I started to read the tutorial and followed its steps:
tns test initnpm i @types/jasmine --save-devtns test ios --emulator
But the only result was a lot a lot of errors on cli complaining about a file missing (node_pre-gyp). After some investigation I realized that even in a simple template app I had the same issues. That’s why I suspected that it is NativeScripts fault and wanted to open a bug report. While collecting the logs for it I saw that already while initializing the projects for tests there showed up some errors with node-pre-gyp. The following steps helped me out:
- I deleted my .npm in my home but had some other problems like
cwd = process.cwd(); Error: ENOENT: no such file or directory, uv_cwdafter that so I did sudo npm cache clean -fandsudo npm install -g ntns test initstill showed some problems withnode-pre-gypandabbrevso I copied these dependencies from my .npm to app/node_modules/fsevents
and viola my tests are running now.