test: call "expect()" on a correct call stack (#23675)
This commit is contained in:
parent
9d851b8791
commit
33d6a99d40
3 changed files with 36 additions and 49 deletions
|
@ -44,7 +44,7 @@ describe('ipc module', () => {
|
|||
it('receives a response from an asynchronous handler', async () => {
|
||||
ipcMain.handleOnce('test', async (e: IpcMainInvokeEvent, arg: number) => {
|
||||
expect(arg).to.equal(123);
|
||||
await new Promise(resolve => setImmediate(resolve));
|
||||
await new Promise(setImmediate);
|
||||
return 3;
|
||||
});
|
||||
const done = new Promise(resolve => ipcMain.once('result', (e, arg) => {
|
||||
|
@ -69,7 +69,7 @@ describe('ipc module', () => {
|
|||
|
||||
it('receives an error from an asynchronous handler', async () => {
|
||||
ipcMain.handleOnce('test', async () => {
|
||||
await new Promise(resolve => setImmediate(resolve));
|
||||
await new Promise(setImmediate);
|
||||
throw new Error('some error');
|
||||
});
|
||||
const done = new Promise(resolve => ipcMain.once('result', (e, arg) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue