feat: remove on(ready) requirement from powerMonitor (#37937)
This commit is contained in:
parent
908bef7ca9
commit
fef1b04238
3 changed files with 25 additions and 24 deletions
|
@ -8,7 +8,7 @@
|
|||
// python-dbusmock.
|
||||
import { expect } from 'chai';
|
||||
import * as dbus from 'dbus-native';
|
||||
import { ifdescribe } from './lib/spec-helpers';
|
||||
import { ifdescribe, startRemoteControlApp } from './lib/spec-helpers';
|
||||
import { promisify } from 'util';
|
||||
import { setTimeout } from 'timers/promises';
|
||||
|
||||
|
@ -135,6 +135,11 @@ describe('powerMonitor', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('is usable before app ready', async () => {
|
||||
const remoteApp = await startRemoteControlApp(['--boot-eval=globalThis.initialValue=require("electron").powerMonitor.getSystemIdleTime()']);
|
||||
expect(await remoteApp.remoteEval('globalThis.initialValue')).to.be.a('number');
|
||||
});
|
||||
|
||||
describe('when powerMonitor module is loaded', () => {
|
||||
// eslint-disable-next-line no-undef
|
||||
let powerMonitor: typeof Electron.powerMonitor;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue