@@ -18,29 +18,15 @@ describe('utils/findProjectRoot', () => {
18
18
} ) ;
19
19
20
20
describe ( 'utils/zip' , ( ) => {
21
- const mtime = new Date ( 2024 , 0 , 1 , 0 , 0 , 0 , 0 ) ;
22
-
23
21
beforeEach ( ( ) => {
24
22
mockFs ( {
25
- '/src' : mockFs . directory ( {
26
- mtime,
27
- items : {
28
- 'test.txt' : mockFs . file ( {
29
- mtime,
30
- content : 'lorem ipsum' ,
31
- } ) ,
32
- modules : mockFs . directory ( {
33
- mtime,
34
- items : {
35
- 'module.txt' : mockFs . file ( {
36
- mtime,
37
- content : 'lorem ipsum 2' ,
38
- } ) ,
39
- } ,
40
- } ) ,
23
+ '/src' : {
24
+ 'test.txt' : 'lorem ipsum' ,
25
+ modules : {
26
+ 'module.txt' : 'lorem ipsum 2' ,
41
27
} ,
42
- } ) ,
43
- '/dist' : mockFs . directory ( { mtime } ) ,
28
+ } ,
29
+ '/dist' : { } ,
44
30
} ) ;
45
31
} ) ;
46
32
@@ -79,17 +65,7 @@ describe('utils/zip', () => {
79
65
} ,
80
66
] ;
81
67
82
- // Check the mtimes are set correctly
83
- const sourceStat = fs . statSync ( source ) ;
84
- expect ( sourceStat . mtime ) . toEqual ( mtime ) ;
85
-
86
- const testStat = fs . statSync ( '/src/test.txt' ) ;
87
- expect ( testStat . mtime ) . toEqual ( mtime ) ;
88
-
89
- const moduleStat = fs . statSync ( '/src/modules/module.txt' ) ;
90
- expect ( moduleStat . mtime ) . toEqual ( mtime ) ;
91
-
92
- await expect ( zip ( zipPath , filesPathList , useNativeZip ) ) . resolves . toBeUndefined ( ) ;
68
+ await zip ( zipPath , filesPathList , useNativeZip ) ;
93
69
94
70
expect ( fs . existsSync ( zipPath ) ) . toEqual ( true ) ;
95
71
@@ -103,7 +79,7 @@ describe('utils/zip', () => {
103
79
if ( ! useNativeZip ) {
104
80
const data = fs . readFileSync ( zipPath ) ;
105
81
const fileHash = crypto . createHash ( 'sha256' ) . update ( data ) . digest ( 'base64' ) ;
106
- expect ( fileHash ) . toEqual ( 'PHu2gv7OIMv+lAOCXYPNd30X8/7EKYTuV7KYJjw3Qd4 =' ) ;
82
+ expect ( fileHash ) . toEqual ( 'iCZdyHJ7ON2LLwBIE6gQmRvBTzXBogSqJTMvHSenzGk =' ) ;
107
83
}
108
84
}
109
85
) ;
0 commit comments