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
|
@ -7,7 +7,7 @@ import * as ChildProcess from 'child_process';
|
|||
import { session, net } from 'electron/main';
|
||||
import { Socket } from 'net';
|
||||
import { ifit, listen } from './lib/spec-helpers';
|
||||
import { emittedOnce } from './lib/events-helpers';
|
||||
import { once } from 'events';
|
||||
|
||||
const appPath = path.join(__dirname, 'fixtures', 'api', 'net-log');
|
||||
const dumpFile = path.join(os.tmpdir(), 'net_log.json');
|
||||
|
@ -127,7 +127,7 @@ describe('netLog module', () => {
|
|||
}
|
||||
});
|
||||
|
||||
await emittedOnce(appProcess, 'exit');
|
||||
await once(appProcess, 'exit');
|
||||
expect(fs.existsSync(dumpFile)).to.be.true('dump file exists');
|
||||
});
|
||||
|
||||
|
@ -142,7 +142,7 @@ describe('netLog module', () => {
|
|||
}
|
||||
});
|
||||
|
||||
await emittedOnce(appProcess, 'exit');
|
||||
await once(appProcess, 'exit');
|
||||
expect(fs.existsSync(dumpFile)).to.be.true('dump file exists');
|
||||
expect(fs.existsSync(dumpFileDynamic)).to.be.true('dynamic dump file exists');
|
||||
});
|
||||
|
@ -156,7 +156,7 @@ describe('netLog module', () => {
|
|||
}
|
||||
});
|
||||
|
||||
await emittedOnce(appProcess, 'exit');
|
||||
await once(appProcess, 'exit');
|
||||
expect(fs.existsSync(dumpFileDynamic)).to.be.true('dynamic dump file exists');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue