Title: unit testing for freshly created angular project is broken when import a package from node_modules · Issue #4244 · NativeScript/nativescript-cli · GitHub
Open Graph Title: unit testing for freshly created angular project is broken when import a package from node_modules · Issue #4244 · NativeScript/nativescript-cli
X Title: unit testing for freshly created angular project is broken when import a package from node_modules · Issue #4244 · NativeScript/nativescript-cli
Description: Environment $ tns doctor ✔ Getting environment information No issues were detected. ✔ Your ANDROID_HOME environment variable is set and points to correct directory. ✔ Your adb from the Android SDK is correctly installed. ✔ The Android SD...
Open Graph Description: Environment $ tns doctor ✔ Getting environment information No issues were detected. ✔ Your ANDROID_HOME environment variable is set and points to correct directory. ✔ Your adb from the Android SDK ...
X Description: Environment $ tns doctor ✔ Getting environment information No issues were detected. ✔ Your ANDROID_HOME environment variable is set and points to correct directory. ✔ Your adb from the Android SDK ...
Opengraph URL: https://github.com/NativeScript/nativescript-cli/issues/4244
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"unit testing for freshly created angular project is broken when import a package from node_modules","articleBody":"**Environment**\r\n$ tns doctor\r\n✔ Getting environment information\r\n\r\nNo issues were detected.\r\n✔ Your ANDROID_HOME environment variable is set and points to correct directory.\r\n✔ Your adb from the Android SDK is correctly installed.\r\n✔ The Android SDK is installed.\r\n✔ A compatible Android SDK for compilation is found.\r\n✔ Javac is installed and is configured properly.\r\n✔ The Java Development Kit (JDK) is installed and is configured properly.\r\n✔ Xcode is installed and is configured properly.\r\n✔ xcodeproj is installed and is configured properly.\r\n✔ CocoaPods are installed.\r\n✔ CocoaPods update is not required.\r\n✔ CocoaPods are configured properly.\r\n✔ Your current CocoaPods version is newer than 1.0.0.\r\n✔ Python installed and configured correctly.\r\n✔ The Python 'six' package is found.\r\n✔ Xcode version 10.1.0 satisfies minimum required version 9.\r\n✔ Getting NativeScript components versions information...\r\n✔ Component nativescript has 5.1.0 version and is up to date.\r\n✔ Component tns-core-modules has 5.1.0 version and is up to date.\r\n✔ Component tns-android has 5.1.0 version and is up to date.\r\n✔ Component tns-ios has 5.1.0 version and is up to date.\r\n\r\nkarma.conf.js contains\r\n// list of files / patterns to load in the browser\r\nfiles: [\r\n'src/tests/**/*.js'\r\n],\r\n\r\nthe same issue on **iOS** and **Android** devices\r\n\r\n**Describe the bug**\r\nunit testing for freshly created angular project is broken when import a package from node_modules\r\n \r\n**To Reproduce**\r\nI followed steps for workarounds provided in https://github.com/NativeScript/nativescript-cli/issues/4232\r\nthen I added\r\n`import { expect } from 'chai';`\r\nmy test fails with error message:\r\n\r\n 5 12 2018 15:02:23.006:WARN [NativeScript / 28 (9; Android SDK built for x86)]: Adapter did not report total number of specs.\r\n NativeScript / 28 (9; Android SDK built for x86) ../../tests/example.spec.js at line 0 FAILED\r\n Error: com.tns.NativeScriptException: Failed to find module: \"chai\", relative to: app/tns_modules/\r\n com.tns.Module.resolvePathHelper(Module.java:146)\r\n com.tns.Module.resolvePath(Module.java:55)\r\n com.tns.Runtime.callJSMethodNative(Native Method)\r\n com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1120)\r\n com.tns.Runtime.callJSMethodImpl(Runtime.java:1000)\r\n com.tns.Runtime.callJSMethod(Runtime.java:987)\r\n com.tns.Runtime.callJSMethod(Runtime.java:967)\r\n com.tns.Runtime.callJSMethod(Runtime.java:959)\r\n com.tns.gen.java.lang.Runnable.run(Runnable.java:15)\r\n android.os.Handler.handleCallback(Handler.java:873)\r\n android.os.Handler.dispatchMessage(Handler.java:99)\r\n android.os.Looper.loop(Looper.java:193)\r\n android.app.ActivityThread.main(ActivityThread.java:6669)\r\n java.lang.reflect.Method.invoke(Native Method)\r\n com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)\r\n com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)\r\n NativeScript / 28 (9; Android SDK built for x86): Executed 1 of null (1 FAILED) ERROR (0.056 secs / 0 secs)\r\n Test run failed.\r\n\r\nit looks like test runner is not able to find installed chai npm package\r\n\r\nI commented out \"chai\" and tried \"sinon\" instead.\r\nThe same result \r\n\r\n**Expected behavior**\r\nI should be able to use import statements for node packages\r\n\r\n_**Is there any workaround for this one?**_\r\n","author":{"url":"https://github.com/ochemerys","@type":"Person","name":"ochemerys"},"datePublished":"2018-12-20T16:34:54Z","url":"https://github.com/NativeScript/nativescript-cli/issues/4244"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a6743eb0-e4e2-e56e-022a-abb846936a23 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C88E:38EE04:C90F51:10A8BEE:6B01C7DA |
| html-safe-nonce | 008552cd8893cd2cefb813488c55449100a6b14b17e4ff73968a20fda41b8dfe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODhFOjM4RUUwNDpDOTBGNTE6MTBBOEJFRTo2QjAxQzdEQSIsInZpc2l0b3JfaWQiOiIyMjU4NTE4Mjc4MjAyODM2OTU0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7985190b3bf01574c4da09925dad3d14f2306764b0fb2898ffa1f058dfd9e86d |
| hovercard-subject-tag | issue:393122338 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/nativescript-cli/4244/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9e7a5efda54d2e815b3f9c5751509540ee803cae29bc4f0210f207c55b5a0b33/NativeScript/nativescript-cli/issues/4244 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9e7a5efda54d2e815b3f9c5751509540ee803cae29bc4f0210f207c55b5a0b33/NativeScript/nativescript-cli/issues/4244 |
| og:image:alt | Environment $ tns doctor ✔ Getting environment information No issues were detected. ✔ Your ANDROID_HOME environment variable is set and points to correct directory. ✔ Your adb from the Android SDK ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ochemerys |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/nativescript-cli git https://github.com/NativeScript/nativescript-cli.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 21347346 |
| octolytics-dimension-repository_nwo | NativeScript/nativescript-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21347346 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/nativescript-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width