Skip to content

Commit 05587d1

Browse files
committed
test: issue 23
1 parent 20fb6fa commit 05587d1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* eslint no-unused-expressions: 0 */
2+
import "mocha";
3+
import { expect } from "chai";
4+
import { set } from "../../lib/set";
5+
6+
describe("pointer.set", () => {
7+
it("should merge properties in array items", () => {
8+
const obj: Record<string, any> = {};
9+
10+
set(obj, '/list/[0]/itemA', 1)
11+
set(obj, '/list/[0]/itemB', 1)
12+
13+
expect(obj.list).to.deep.equal([{ itemA: 1, itemB: 1 }]);
14+
});
15+
});

0 commit comments

Comments
 (0)