@@ -7,14 +7,16 @@ import { PassThrough } from 'stream';
77import mockDataLatestRelease from '../../test/resources/github-latest-release.json' ;
88import noX64Assets from '../../test/resources/github-releases-no-x64.json' ;
99import { sync } from './syncer' ;
10+ import { describe , test , expect , beforeEach , beforeAll , afterEach , afterAll , vi } from 'vitest' ;
11+
1012
1113const mockOctokit = {
1214 repos : {
13- getLatestRelease : jest . fn ( ) ,
15+ getLatestRelease : vi . fn ( ) ,
1416 } ,
1517} ;
16- jest . mock ( '@octokit/rest' , ( ) => ( {
17- Octokit : jest . fn ( ) . mockImplementation ( ( ) => mockOctokit ) ,
18+ vi . mock ( '@octokit/rest' , ( ) => ( {
19+ Octokit : vi . fn ( ) . mockImplementation ( ( ) => mockOctokit ) ,
1820} ) ) ;
1921
2022// mock stream for Axios
@@ -23,8 +25,8 @@ const mockStream = new PassThrough();
2325mockStream . push ( mockResponse ) ;
2426mockStream . end ( ) ;
2527
26- jest . mock ( 'axios' ) ;
27- const mockAxios = axios as jest . Mocked < typeof axios > ;
28+ vi . mock ( 'axios' ) ;
29+ const mockAxios = axios as vi . Mocked < typeof axios > ;
2830mockAxios . get . mockResolvedValue ( {
2931 data : mockStream ,
3032} ) ;
@@ -49,11 +51,11 @@ const runnerOs = [['linux'], ['win']];
4951const latestRelease = '2.296.2' ;
5052
5153beforeEach ( ( ) => {
52- jest . clearAllMocks ( ) ;
54+ vi . clearAllMocks ( ) ;
5355 mockS3client . reset ( ) ;
5456} ) ;
5557
56- jest . setTimeout ( 60 * 1000 ) ;
58+ vi . setConfig ( { testTimeout : 60 * 1000 } ) ;
5759
5860describe ( 'Synchronize action distribution (no S3 tags).' , ( ) => {
5961 beforeEach ( ( ) => {
0 commit comments