@@ -3,11 +3,11 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
33const { mockElectron } = vi . hoisted ( ( ) => ( {
44 mockElectron : {
55 setBasePath : vi . fn ( ) ,
6- reinstall : vi . fn < [ ] , Promise < void > > ( ) . mockResolvedValue ( undefined ) ,
6+ reinstall : vi . fn < ( ) => Promise < void > > ( ) . mockResolvedValue ( undefined ) ,
77 uv : {
8- installRequirements : vi . fn < [ ] , Promise < void > > ( ) ,
9- clearCache : vi . fn < [ ] , Promise < void > > ( ) . mockResolvedValue ( undefined ) ,
10- resetVenv : vi . fn < [ ] , Promise < void > > ( ) . mockResolvedValue ( undefined )
8+ installRequirements : vi . fn < ( ) => Promise < void > > ( ) ,
9+ clearCache : vi . fn < ( ) => Promise < void > > ( ) . mockResolvedValue ( undefined ) ,
10+ resetVenv : vi . fn < ( ) => Promise < void > > ( ) . mockResolvedValue ( undefined )
1111 }
1212 }
1313} ) )
@@ -48,24 +48,24 @@ describe('desktopMaintenanceTasks', () => {
4848 } )
4949
5050 describe ( 'URL-opening tasks' , ( ) => {
51- it ( 'git execute opens the git download page' , ( ) => {
52- findTask ( 'git' ) . execute ( )
51+ it ( 'git execute opens the git download page' , async ( ) => {
52+ expect ( await findTask ( 'git' ) . execute ( ) ) . toBe ( true )
5353 expect ( window . open ) . toHaveBeenCalledWith (
5454 'https://git-scm.com/downloads/' ,
5555 '_blank'
5656 )
5757 } )
5858
59- it ( 'uv execute opens the uv installation page' , ( ) => {
60- findTask ( 'uv' ) . execute ( )
59+ it ( 'uv execute opens the uv installation page' , async ( ) => {
60+ expect ( await findTask ( 'uv' ) . execute ( ) ) . toBe ( true )
6161 expect ( window . open ) . toHaveBeenCalledWith (
6262 'https://docs.astral.sh/uv/getting-started/installation/' ,
6363 '_blank'
6464 )
6565 } )
6666
67- it ( 'vcRedist execute opens the VC++ redistributable download' , ( ) => {
68- findTask ( 'vcRedist' ) . execute ( )
67+ it ( 'vcRedist execute opens the VC++ redistributable download' , async ( ) => {
68+ expect ( await findTask ( 'vcRedist' ) . execute ( ) ) . toBe ( true )
6969 expect ( window . open ) . toHaveBeenCalledWith (
7070 'https://aka.ms/vs/17/release/vc_redist.x64.exe' ,
7171 '_blank'
0 commit comments