Skip to content

Commit

Permalink
update test in accessing computed within effects
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyw committed Oct 6, 2022
1 parent de43391 commit b1a665c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/test/signal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ describe("effect()", () => {
expect(fn).to.throw(/Cycle detected/);
});

it("should throw on indirect cycles", () => {
it("should throw if a computed tries to set a signal's value", () => {
const a = signal(0);
let i = 0;

Expand All @@ -543,7 +543,7 @@ describe("effect()", () => {
c.value;
});

expect(fn).to.throw(/Cycle detected/);
expect(fn).to.throw(/Computed cannot have side-effects/);
});

it("should allow disposing the effect multiple times", () => {
Expand Down

0 comments on commit b1a665c

Please sign in to comment.