Skip to content

Instantly share code, notes, and snippets.

@MauricioAires
Created January 26, 2023 18:49
Show Gist options
  • Save MauricioAires/cafd0692a553c4d080a99d04e09a0505 to your computer and use it in GitHub Desktop.
Save MauricioAires/cafd0692a553c4d080a99d04e09a0505 to your computer and use it in GitHub Desktop.

Using React Testing Library

debugging

Documentação

O Testing Playground permite que você renderize um componente em um sandbox fornecendo feedback visual direto do componente renderizado para obter as melhores consultas para selecionar elementos. E, assim como a Testing Library, tudo o que ela faz tem acessibilidade (a11y) em mente, então ensina sobre a importância da a11y e as melhores práticas enquando você a usa.

describe('<Component />', () => {
  it('should render logTestingPlaygroundURl', () => {
    sut();

    expect(screen.logTestingPlaygroundURL());
  });
});

Quando você acessar o link gerado após rodar o teste irá ver uma tela parecida com essa:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment