1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00
Files
node-redis/packages/client/lib/commands/BGSAVE.spec.ts
2023-09-18 15:03:07 -04:00

33 lines
764 B
TypeScript

import { strict as assert } from 'node:assert';
import testUtils, { GLOBAL } from '../test-utils';
import BGSAVE from './BGSAVE';
describe('BGSAVE', () => {
describe('transformArguments', () => {
it('simple', () => {
assert.deepEqual(
BGSAVE.transformArguments(),
['BGSAVE']
);
});
it('with SCHEDULE', () => {
assert.deepEqual(
BGSAVE.transformArguments({
SCHEDULE: true
}),
['BGSAVE', 'SCHEDULE']
);
});
});
testUtils.testWithClient('client.bgSave', async client => {
assert.equal(
typeof await client.bgSave({
SCHEDULE: true // using `SCHEDULE` to make sure it won't throw an error
}),
'string'
);
}, GLOBAL.SERVERS.OPEN);
});