Utilização

Define a screen behavior test.

tsx
// Define a screen behavior test.
import { Button, Text, VStack, signal } from 'kuito';
import { assert, press, render, screen, test } from 'kuito/tests';

function Counter() {
  const count = signal(0);

  return (
    <VStack>
      <Text>{String(count.value)}</Text>
      <Button onPress={() => (count.value += 1)}>Add one</Button>
    </VStack>
  );
}

test('Add one counts the presses', async () => {
  await render(<Counter />);

  await press(screen.getByText('Add one'));

  assert.ok(screen.getByText('1'));
});

Assinaturas

Sobrecarga 1

ts
(name: string, body: Body): void

Parâmetros

NomeTipoObrigatórioDescrição
namestringSim—
bodyBodySim—

Devolve

void

Sobrecarga 2

ts
(name: string, options: { skip?: boolean | string; only?: boolean; timeout?: number; }, body: Body): void

Parâmetros

NomeTipoObrigatórioDescrição
namestringSim—
options{ skip?: boolean | string; only?: boolean; timeout?: number;}Sim—
bodyBodySim—

Devolve

void

Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.