test: use node helpers for events.once and setTimeout promise (#37374)
This commit is contained in:
parent
46c8b9c728
commit
a3e3efe4c4
47 changed files with 932 additions and 927 deletions
|
@ -8,8 +8,9 @@
|
|||
// python-dbusmock.
|
||||
import { expect } from 'chai';
|
||||
import * as dbus from 'dbus-native';
|
||||
import { ifdescribe, delay } from './lib/spec-helpers';
|
||||
import { ifdescribe } from './lib/spec-helpers';
|
||||
import { promisify } from 'util';
|
||||
import { setTimeout } from 'timers/promises';
|
||||
|
||||
describe('powerMonitor', () => {
|
||||
let logindMock: any, dbusMockPowerMonitor: any, getCalls: any, emitSignal: any, reset: any;
|
||||
|
@ -59,7 +60,7 @@ describe('powerMonitor', () => {
|
|||
while (retriesRemaining-- > 0) {
|
||||
calls = await getCalls();
|
||||
if (calls.length > 0) break;
|
||||
await delay(1000);
|
||||
await setTimeout(1000);
|
||||
}
|
||||
expect(calls).to.be.an('array').that.has.lengthOf(1);
|
||||
expect(calls[0].slice(1)).to.deep.equal([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue