Skip to content

Commit

Permalink
Update test comments for SET
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Carbonetto <[email protected]>
  • Loading branch information
acarbonetto committed Jun 4, 2024
1 parent bc878a5 commit 6f246a0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions node/tests/SharedTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2606,6 +2606,10 @@ export function runBaseTests<Context>(config: {
const key = uuidv4();
const value = uuidv4();

// set with multiple options:
// * only apply SET if the key already exists
// * expires after 1 second
// * returns the old value
const setResWithAllOptions = await client.set(key, value, {
expiry: {
type: "unixSeconds",
Expand All @@ -2616,9 +2620,8 @@ export function runBaseTests<Context>(config: {
});
// key does not exist, so old value should be null
expect(setResWithAllOptions).toEqual(null);
// key should have been set
const getResWithAllOptions = await client.get(key);
expect(getResWithAllOptions).toEqual(null);
// key does not exist, so SET should not have applied
expect(await client.get(key)).toEqual(null);
}

async function testSetWithAllCombination(client: BaseClient) {
Expand Down

0 comments on commit 6f246a0

Please sign in to comment.