Skip to content

Commit 7bca5ef

Browse files
committed
RI-4985 fix unit test
1 parent dcf34b4 commit 7bca5ef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

redisinsight/api/src/modules/browser/rejson-rl/rejson-rl.service.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,6 @@ describe('JsonService', () => {
10801080
describe('arrAppend', () => {
10811081
beforeEach(() => {
10821082
databaseService.get.mockResolvedValue(mockDatabaseWithModules);
1083-
client.sendCommand.mockReturnValue('OK');
10841083
});
10851084
it('should throw NotFound error when key does not exists', async () => {
10861085
client.sendCommand.mockReturnValue(0);
@@ -1134,6 +1133,10 @@ describe('JsonService', () => {
11341133
}
11351134
});
11361135
it('should successful modify data', async () => {
1136+
client.sendCommand.mockReturnValueOnce('OK');
1137+
// JSON.ARRAPEND returns an array of integer replies for each path, the array's new size,
1138+
// or nil, if the matching JSON value is not an array
1139+
client.sendCommand.mockReturnValueOnce([10]);
11371140
await service.arrAppend(mockBrowserClientMetadata, {
11381141
keyName: testKey,
11391142
path: testPath,

0 commit comments

Comments
 (0)