@@ -66,6 +66,44 @@ describe("GcpClient", () => {
66
66
gcpClient . uploadFile ( mockFilePath , mockDestinationPath )
67
67
) . rejects . toThrow ( "Upload failed" ) ;
68
68
} ) ;
69
+
70
+ it ( "should normalize Windows-style paths to use forward slashes" , async ( ) => {
71
+ // Arrange
72
+ const windowsPath = "path\\in\\bucket\\file.txt" ;
73
+ const expectedPath = "path/in/bucket/file.txt" ;
74
+ const mockStorage = new Storage ( ) ;
75
+ const mockBucket = mockStorage . bucket ( mockBucketName ) ;
76
+
77
+ // Act
78
+ await gcpClient . uploadFile ( mockFilePath , windowsPath ) ;
79
+
80
+ // Assert
81
+ expect ( mockBucket . upload ) . toHaveBeenCalledWith ( mockFilePath , {
82
+ destination : expectedPath ,
83
+ metadata : {
84
+ cacheControl : "public, max-age=31536000" ,
85
+ } ,
86
+ } ) ;
87
+ } ) ;
88
+
89
+ it ( "should handle paths with mixed separators" , async ( ) => {
90
+ // Arrange
91
+ const mixedPath = "path\\in/bucket\\file.txt" ;
92
+ const expectedPath = "path/in/bucket/file.txt" ;
93
+ const mockStorage = new Storage ( ) ;
94
+ const mockBucket = mockStorage . bucket ( mockBucketName ) ;
95
+
96
+ // Act
97
+ await gcpClient . uploadFile ( mockFilePath , mixedPath ) ;
98
+
99
+ // Assert
100
+ expect ( mockBucket . upload ) . toHaveBeenCalledWith ( mockFilePath , {
101
+ destination : expectedPath ,
102
+ metadata : {
103
+ cacheControl : "public, max-age=31536000" ,
104
+ } ,
105
+ } ) ;
106
+ } ) ;
69
107
} ) ;
70
108
71
109
describe ( "listContent" , ( ) => {
0 commit comments