Skip to content

Commit e6aaabc

Browse files
committed
fix spec
1 parent cc6daa3 commit e6aaabc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/local-storage-engine.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ describe('LocalStorageEngine Compression Migration', () => {
109109

110110
expect(mockLocalStorage.setItem).toHaveBeenCalledWith(
111111
'eppo-configuration-test',
112-
LZString.compress(testData),
112+
LZString.compressToBase64(testData),
113113
);
114114
});
115115

116116
it('should decompress data when reading', async () => {
117117
const testData = JSON.stringify({ flag: 'test-flag', value: 'test-value' });
118-
const compressedData = LZString.compress(testData);
118+
const compressedData = LZString.compressToBase64(testData);
119119

120120
(mockLocalStorage.getItem as jest.Mock).mockImplementation((key) => {
121121
if (key === 'eppo-meta') return JSON.stringify({ version: 1, migratedAt: Date.now() });
@@ -130,7 +130,7 @@ describe('LocalStorageEngine Compression Migration', () => {
130130

131131
it('should handle decompression errors gracefully', async () => {
132132
// Mock LZString.decompress to throw an error
133-
const decompressSpy = jest.spyOn(LZString, 'decompress').mockImplementation(() => {
133+
const decompressSpy = jest.spyOn(LZString, 'decompressFromBase64').mockImplementation(() => {
134134
throw new Error('Decompression failed');
135135
});
136136

@@ -226,7 +226,7 @@ describe('LocalStorageEngine Compression Migration', () => {
226226
};
227227

228228
const originalJson = JSON.stringify(largeConfig);
229-
const compressedData = LZString.compress(originalJson);
229+
const compressedData = LZString.compressToBase64(originalJson);
230230

231231
// Verify compression actually reduces size
232232
expect(compressedData.length).toBeLessThan(originalJson.length);

0 commit comments

Comments
 (0)