Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/client/lib/commands/XTRIM.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ describe('XTRIM', () => {
parseArgs(XTRIM, 'key', 'MINID', 123),
['XTRIM', 'key', 'MINID', '123']
);

assert.deepEqual(
parseArgs(XTRIM, 'key', 'MINID', '0-0'),
['XTRIM', 'key', 'MINID', '0-0']
);
});

it('with strategyModifier', () => {
Expand Down Expand Up @@ -89,6 +94,16 @@ describe('XTRIM', () => {
cluster: GLOBAL.CLUSTERS.OPEN,
});

testUtils.testAll('xTrim with string MINID', async client => {
assert.equal(
typeof await client.xTrim('key', 'MINID', '0-0'),
'number'
);
}, {
client: GLOBAL.SERVERS.OPEN,
cluster: GLOBAL.CLUSTERS.OPEN,
});

testUtils.testAll(
'xTrim with LIMIT',
async (client) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/XTRIM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default {
parser: CommandParser,
key: RedisArgument,
strategy: 'MAXLEN' | 'MINID',
threshold: number,
threshold: number | string,
options?: XTrimOptions
) {
parser.push('XTRIM')
Expand Down
Loading