{"action":"created","issue":{"url":"https://api.github.com/repos/electron/electron/issues/15215","repository_url":"https://api.github.com/repos/electron/electron","labels_url":"https://api.github.com/repos/electron/electron/issues/15215/labels{/name}","comments_url":"https://api.github.com/repos/electron/electron/issues/15215/comments","events_url":"https://api.github.com/repos/electron/electron/issues/15215/events","html_url":"https://github.com/electron/electron/issues/15215","id":370986511,"node_id":"MDU6SXNzdWUzNzA5ODY1MTE=","number":15215,"title":"Unit tests is giving ** fs.existsSync() is not a function ** Error for Electron- Angular 5 Desktop App","user":{"login":"venkateshp241093","id":21010922,"node_id":"MDQ6VXNlcjIxMDEwOTIy","avatar_url":"https://avatars0.githubusercontent.com/u/21010922?v=4","gravatar_id":"","url":"https://api.github.com/users/venkateshp241093","html_url":"https://github.com/venkateshp241093","followers_url":"https://api.github.com/users/venkateshp241093/followers","following_url":"https://api.github.com/users/venkateshp241093/following{/other_user}","gists_url":"https://api.github.com/users/venkateshp241093/gists{/gist_id}","starred_url":"https://api.github.com/users/venkateshp241093/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/venkateshp241093/subscriptions","organizations_url":"https://api.github.com/users/venkateshp241093/orgs","repos_url":"https://api.github.com/users/venkateshp241093/repos","events_url":"https://api.github.com/users/venkateshp241093/events{/privacy}","received_events_url":"https://api.github.com/users/venkateshp241093/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-17T09:43:50Z","updated_at":"2018-12-06T06:53:28Z","closed_at":"2018-10-18T00:04:59Z","author_association":"NONE","body":"Hi,\r\n \r\nWe are facing a problem in executing the unit test written for our desktop application developed in Electron + Angular 5 JavaScript frameworks.\r\n \r\nDetails:\r\n1.\tWe have created a Desktop application to access and modify the device configurations attached to PC over USB, we have below components in the application.\r\n2.\tWe have an SDK which is written in C++ to do low level interaction with the device.\r\n3.\tWe have a wrapper around the SDK C++ APIs which is written in NodeJS and a Native Node module is created in NodeJS.\r\n4.\tIn the UI application, we access the Native Node module which is created as wrappers and we access and modify the device configurations.\r\n5.\tUI application is written in ElectronJS build framework and Angular 5.\r\n \r\nThe application is working fine without any issues and but we are facing an issue to create unit test’s\r\n \r\nFor unit test, we are using Jasmine and Karma frameworks to write and execute tests.\r\nWhere it throws a compilation error as below, which is common across the dependencies of the application.\r\n \r\n\r\n \r\nERROR in ./src/renderer/app/providers/diagnostics.service.ts\r\nModule not found: Error: Can't resolve 'fs' in '/Users/venkatesh/Desktop/Myproject/src/renderer/app/providers'\r\n@ ./src/renderer/app/providers/diagnostics.service.ts 112:29-42 184:25-38\r\n@ ./src/renderer/app/providers/diagnostics.service.spec.ts\r\n@ ./src/renderer \\.spec\\.ts$\r\n@ ./src/renderer/test.ts\r\n\r\n\r\nWe tried using webpack: { node : { fs: 'empty' }} in karma.conf.js\r\n \r\nBut later it throws an error as below\r\n\r\nfs.existsSync() is not a function.\r\n \r\n \r\nfs.existsSync() is a function which is called in Electron Node module and it throws an error as above.\r\n\r\n\r\nExpected: \r\n\r\nThe unit tests compiles and the test is started.\r\n\r\n \r\nAny solutions or pointer to resolve this issue would be of great help.\r\n\r\n\r\nThanks in advance,"},"comment":{"url":"https://api.github.com/repos/electron/electron/issues/comments/444767701","html_url":"https://github.com/electron/electron/issues/15215#issuecomment-444767701","issue_url":"https://api.github.com/repos/electron/electron/issues/15215","id":444767701,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDc2NzcwMQ==","user":{"login":"lpt9","id":45647323,"node_id":"MDQ6VXNlcjQ1NjQ3MzIz","avatar_url":"https://avatars1.githubusercontent.com/u/45647323?v=4","gravatar_id":"","url":"https://api.github.com/users/lpt9","html_url":"https://github.com/lpt9","followers_url":"https://api.github.com/users/lpt9/followers","following_url":"https://api.github.com/users/lpt9/following{/other_user}","gists_url":"https://api.github.com/users/lpt9/gists{/gist_id}","starred_url":"https://api.github.com/users/lpt9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpt9/subscriptions","organizations_url":"https://api.github.com/users/lpt9/orgs","repos_url":"https://api.github.com/users/lpt9/repos","events_url":"https://api.github.com/users/lpt9/events{/privacy}","received_events_url":"https://api.github.com/users/lpt9/received_events","type":"User","site_admin":false},"created_at":"2018-12-06T06:53:28Z","updated_at":"2018-12-06T06:53:28Z","author_association":"NONE","body":"I have the same problem. Have you solved it?"}}
{"actor":{"display_login":"lpt9"}}