fix: assert.ok in the renderer process (#46561)

fix: assert.ok in the renderer process

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2025-04-08 14:47:52 -05:00 committed by GitHub
parent 4f54c91ee2
commit 33964528e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 18 deletions

View file

@ -983,6 +983,17 @@ describe('node feature', () => {
});
});
itremote('handles assert module assertions as expected', () => {
const assert = require('node:assert');
try {
assert.ok(false);
expect.fail('assert.ok(false) should throw');
} catch (err) {
console.log(err);
expect(err).to.be.instanceOf(assert.AssertionError);
}
});
it('Can find a module using a package.json main field', () => {
const result = childProcess.spawnSync(process.execPath, [path.resolve(fixtures, 'api', 'electron-main-module', 'app.asar')], { stdio: 'inherit' });
expect(result.status).to.equal(0);