Skip to content
weftGitHub

Diagnostics

T003

Asserting a value the test just set (n.value = 5; expect(n.value).toBe(5)) without going through the UI or the graph.

Fix: Act through the UI (await user.click(…)) or assert on what depends on the value.

Status in weft@0.1.0: reported by weft check on test files.

Triggers it:

tsx
import { state } from '@weft-js/core'test('count', () => { const n = state(0); n.value = 5; expect(n.value).toBe(5) })

A test that needs it on purpose keeps it with a reason: // weft-allow T003: <why> in the file header (whole file) or on the line above.

More: weft docs testing.