Skip to content

Commit

Permalink
Update computed.spec.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Jun 27, 2024
1 parent 383af2f commit f193037
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/reactivity/__tests__/computed.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,15 +769,15 @@ describe('reactivity/computed', () => {
const v = ref(0)
const c1 = computed(() => {
v.value = 1
return v.value
return 0
})
const c2 = computed(() => {
return v.value + ',' + c1.value
})

expect(c2.value).toBe('0,1')
expect(c2.value).toBe('0,0')
v.value = 1
expect(c2.value).toBe('1,1')
expect(c2.value).toBe('1,0')

Check failure on line 780 in packages/reactivity/__tests__/computed.spec.ts

View workflow job for this annotation

GitHub Actions / unit-test

packages/reactivity/__tests__/computed.spec.ts > reactivity/computed > should be recompute without being affected by side effects

AssertionError: expected '0,0' to be '1,0' // Object.is equality - Expected + Received - 1,0 + 0,0 ❯ packages/reactivity/__tests__/computed.spec.ts:780:22
expect(COMPUTED_SIDE_EFFECT_WARN).toHaveBeenWarned()
})

Expand Down

0 comments on commit f193037

Please sign in to comment.