facebook-atom / jest-electron-runner

custom test runner for Jest that allows tests to be run in Electron environment
MIT License
189 stars 33 forks source link

Wrong .getAppPath result while running test #52

Open bgr11n opened 4 years ago

bgr11n commented 4 years ago

Hi!

I am getting wrong result of app.getAppPath() while running test.

How to reproduce?

Use app.getAppPath() somewhere inside you class, write test for this class, run test.

Actual result:

 C:\Users\Bohdan\projects\electron-first-try\node_modules\@jest-runner\electron\build

Expected result:

 C:\Users\Bohdan\projects\electron-first-try

Or maybe I have wrong configuration somewhere?

Clearmist commented 3 years ago

I believe this is a limitation of this library. The electron process is spawned by this library within @jest-runner/electron so that directory within node_modules becomes the application path when you try app.getAppPath().