fix: expose the built-in electron module via the ESM loader (#35930)
This commit is contained in:
parent
a072f06168
commit
1fe21ff712
3 changed files with 100 additions and 0 deletions
|
@ -174,4 +174,16 @@ describe('modules support', () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('esm', () => {
|
||||
it('can load the built-in "electron" module via ESM import', async () => {
|
||||
await expect(import('electron')).to.eventually.be.ok();
|
||||
});
|
||||
|
||||
it('the built-in "electron" module loaded via ESM import has the same exports as the CJS module', async () => {
|
||||
const esmElectron = await import('electron');
|
||||
const cjsElectron = require('electron');
|
||||
expect(Object.keys(esmElectron)).to.deep.equal(Object.keys(cjsElectron));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue