refactor: use types for once() return values in spec (#38872)
This commit is contained in:
parent
abec9ead06
commit
9226cc662b
11 changed files with 85 additions and 85 deletions
|
@ -6,7 +6,7 @@ import { once } from 'node:events';
|
|||
ifdescribe(!process.mas)('autoUpdater module', function () {
|
||||
describe('checkForUpdates', function () {
|
||||
ifit(process.platform === 'win32')('emits an error on Windows if the feed URL is not set', async function () {
|
||||
const errorEvent = once(autoUpdater, 'error');
|
||||
const errorEvent = once(autoUpdater, 'error') as Promise<[Error]>;
|
||||
autoUpdater.setFeedURL({ url: '' });
|
||||
autoUpdater.checkForUpdates();
|
||||
const [error] = await errorEvent;
|
||||
|
@ -56,7 +56,7 @@ ifdescribe(!process.mas)('autoUpdater module', function () {
|
|||
|
||||
ifdescribe(process.platform === 'darwin' && process.arch !== 'arm64')('on Mac', function () {
|
||||
it('emits an error when the application is unsigned', async () => {
|
||||
const errorEvent = once(autoUpdater, 'error');
|
||||
const errorEvent = once(autoUpdater, 'error') as Promise<[Error]>;
|
||||
autoUpdater.setFeedURL({ url: '' });
|
||||
const [error] = await errorEvent;
|
||||
expect(error.message).equal('Could not get code signature for running application');
|
||||
|
@ -80,7 +80,7 @@ ifdescribe(!process.mas)('autoUpdater module', function () {
|
|||
|
||||
describe('quitAndInstall', () => {
|
||||
ifit(process.platform === 'win32')('emits an error on Windows when no update is available', async function () {
|
||||
const errorEvent = once(autoUpdater, 'error');
|
||||
const errorEvent = once(autoUpdater, 'error') as Promise<[Error]>;
|
||||
autoUpdater.quitAndInstall();
|
||||
const [error] = await errorEvent;
|
||||
expect(error.message).to.equal('No update available, can\'t quit and install');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue