-
Notifications
You must be signed in to change notification settings - Fork 64
Description
I upgraded my project to work as ESM. I use the esm module when running the main script, all my renderer classes are going through a custom protocol that load modules as defined in the ES spec. I am almost ready to release the app but apparently I can't perform tests because everything is crashes. So, similarly to mocha I tried to use --require esm which fixes the problem (electron-mocha uses --require-main or --require). This, however, didn't work. Then I tried a different approach which creates a a common export file just for test, where the main file is a regular Common JS file, but it employs esm module to load a ES file that has exports for the classes. this doesn't work as well. After that I don't really have more ideas how to proceed. Maybe you guys has a similar issue and can help here?
To visualize what I am trying to do.
- the test that includes the CJS file that uses
esm: https://github.com/advanced-rest-client/arc-electron/blob/redesign2020/test/ElectronCookies/SessionManager.main.spec.js#L5 - this is the CJS import file https://github.com/advanced-rest-client/arc-electron/blob/redesign2020/test/module-import.js