-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: return error if compression client is used for incr operation
- Loading branch information
1 parent
72edd17
commit b05a0bb
Showing
4 changed files
with
41 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {v4} from 'uuid'; | ||
|
||
import {SetupIntegrationTest} from './integration-setup'; | ||
|
||
const {client} = SetupIntegrationTest(); | ||
|
||
describe('increment, with compression client', () => { | ||
it('should return error saying compression not supported', async () => { | ||
const key = v4(); | ||
const value = 5; | ||
|
||
// Set initial key value | ||
await client.set(key, value); | ||
|
||
// Increment the value of the key | ||
try { | ||
await client.incr(key); | ||
} catch (error) { | ||
const momentoError = error as { | ||
code: string; | ||
context: {code: string; msg: string; op: string; platform: string}; | ||
}; | ||
expect(momentoError.context.op).toBe('incr'); | ||
expect(momentoError.context.platform).toBe('momento'); | ||
expect(momentoError.context.msg).toBe('compression-not-supported'); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters