Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
PythonFZ committed Oct 29, 2024
1 parent 4222d6c commit da6004a
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions js_tests/native.dict.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,27 @@ test("native_dict_setitem_socket_callback", async () => {

test("native_dict_items", async () => {
dct = new Dict({ client: client, key: "dict:test" });
await dct.setitem(5, "5");
await dct.setitem(6, "6");
await dct.setitem(5, "A5");
await dct.setitem(6, "A6");

const items = await dct.items();
expect(items).toEqual([
[5, "5"],
[6, "6"],
]);
});
expect(items).toEqual([(5, "A5"), (6, "A6")]);
});

test("native_dict_keys", async () => {
dct = new Dict({ client: client, key: "dict:test" });
await dct.setitem(5, "A5");
await dct.setitem(6, "A6");

const keys = await dct.keys();
expect(keys).toEqual([5, 6]);
});

test("native_dict_values", async () => {
dct = new Dict({ client: client, key: "dict:test" });
await dct.setitem(5, "A5");
await dct.setitem(6, "A6");

const values = await dct.values();
expect(values).toEqual(["A5", "A6"]);
});

0 comments on commit da6004a

Please sign in to comment.