@@ -109,13 +109,13 @@ describe('LocalStorageEngine Compression Migration', () => {
109
109
110
110
expect ( mockLocalStorage . setItem ) . toHaveBeenCalledWith (
111
111
'eppo-configuration-test' ,
112
- LZString . compress ( testData ) ,
112
+ LZString . compressToBase64 ( testData ) ,
113
113
) ;
114
114
} ) ;
115
115
116
116
it ( 'should decompress data when reading' , async ( ) => {
117
117
const testData = JSON . stringify ( { flag : 'test-flag' , value : 'test-value' } ) ;
118
- const compressedData = LZString . compress ( testData ) ;
118
+ const compressedData = LZString . compressToBase64 ( testData ) ;
119
119
120
120
( mockLocalStorage . getItem as jest . Mock ) . mockImplementation ( ( key ) => {
121
121
if ( key === 'eppo-meta' ) return JSON . stringify ( { version : 1 , migratedAt : Date . now ( ) } ) ;
@@ -130,7 +130,7 @@ describe('LocalStorageEngine Compression Migration', () => {
130
130
131
131
it ( 'should handle decompression errors gracefully' , async ( ) => {
132
132
// Mock LZString.decompress to throw an error
133
- const decompressSpy = jest . spyOn ( LZString , 'decompress ' ) . mockImplementation ( ( ) => {
133
+ const decompressSpy = jest . spyOn ( LZString , 'decompressFromBase64 ' ) . mockImplementation ( ( ) => {
134
134
throw new Error ( 'Decompression failed' ) ;
135
135
} ) ;
136
136
@@ -226,7 +226,7 @@ describe('LocalStorageEngine Compression Migration', () => {
226
226
} ;
227
227
228
228
const originalJson = JSON . stringify ( largeConfig ) ;
229
- const compressedData = LZString . compress ( originalJson ) ;
229
+ const compressedData = LZString . compressToBase64 ( originalJson ) ;
230
230
231
231
// Verify compression actually reduces size
232
232
expect ( compressedData . length ) . toBeLessThan ( originalJson . length ) ;
0 commit comments