Skip to content
kerfjsGitHub

Diagnostics

T006

Mocking kerf (vi.mock('@kerf-js/core')) or the unit under test, so the test checks the mock.

Fix: Fake the edges (network, storage) and render the real component.

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

Triggers it:

tsx
import { render } from '@kerf-js/core/test'import { Cart } from './Cart'vi.mock('./Cart')test('cart', () => { render(Cart); expect(document.body.textContent).toBe('') })

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

More: kerf docs testing.