[FIX] reactivity: work even if no callback is given

This commit is contained in:
Géry Debongnie
2021-12-22 14:55:06 +01:00
committed by Aaron Bohy
parent 92cc4375f8
commit 06fc3a2c77
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -60,6 +60,13 @@ describe("Reactivity", () => {
expect(Array.isArray(state)).toBe(true);
});
test("work if there are no callback given", () => {
const state = reactive({ a: 1 });
expect(state.a).toBe(1);
state.a = 2;
expect(state.a).toBe(2);
});
test("Throw error if value is not proxifiable", () => {
expect(() => createReactive(1)).toThrow("Cannot make the given value reactive");
});