Skip to content
weftGitHub

Diagnostics

T001

A test with no assertion (or an expect(x) with no matcher): it passes as long as nothing throws. @weft-js/core/test also fails such a test at runtime.

Fix: Assert what the user sees: expect(screen.getByRole(…)).toHaveTextContent(…).

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

Triggers it:

tsx
import { render } from '@weft-js/core/test'import { Cart } from './Cart'test('renders', () => { render(Cart) })

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

More: weft docs testing.