[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 Samuel Degueldre
parent 489e20843c
commit 7fdca35a74
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");
});