Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing steps (seem) to be wrong #109

Open
Suyashtnt opened this issue Aug 4, 2021 · 3 comments
Open

Testing steps (seem) to be wrong #109

Suyashtnt opened this issue Aug 4, 2021 · 3 comments

Comments

@Suyashtnt
Copy link

Describe the bug
I'm trying to test an angular app that uses ngx-electron, so I would assume that the test command template would work, but it doesnt

To Reproduce
Steps to reproduce the behavior:

  1. Initalize nx workspace using angular
  2. add ngx-electron
    2.1 yarn add ngx-electron
    2.2 import NgxElectronModule from it and add it into your app modules import
    2.3 create a service with tests
    2.4 inject ElectronService
  3. add an electron app using this that points to the angular project
  4. run nx run-many --target=test --projects=<frontend-app>,<electron-app> --parallel
  5. See error

Expected behavior
It runs the electron app and works

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 11 Insider build
  • Nx Electron Version 11.1.3

Additional context
If you need code I can provide I repo soon:tm:

@Suyashtnt
Copy link
Author

Ok So I figured out why that error occurs(forgot to import and inject when testing) but it seems that ipcRenderer is null when testing, even though it works perfectly fine normally

image

@bennymeg
Copy link
Owner

bennymeg commented Aug 5, 2021

Hi,
I think you need to run inside an electron app in order that the ipc renderer will be initialized. So you can just test it just on the frontend.

@Suyashtnt
Copy link
Author

Hi,
I think you need to run inside an electron app in order that the ipc renderer will be initialized. So you can just test it just on the frontend.

yes, but how?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants