Make wrapper to render configuration available at the global level
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- javascript, react
Direção de pesquisa
Comece localizando a API configure(...) existente e os pontos de entrada render(...); em seguida, revise os testes que cobrem as opções de render e o comportamento da configuração. Defina como um wrapper configurado globalmente é combinado com um wrapper por chamada ou sobrescrito por ele, e adicione testes mostrando que o wrapper global é aplicado sem quebrar o uso existente de render.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the feature you'd like:
When rendering components for test, I often find myself repeating render(ui, { wrapper: TestApp() }) over and over again.
It would be nice to have a possibility to define the wrapper using a global configure(...) call.
By having this in global config, you could ensure that, by default, all the rendered components are tested in the context resembling the onion structure of various wrappers and context providers that they are going to be embedded in in production code anyway. This would help capture bugs when this context layer has an adverse effect on the behaviour of the component under test.
Describe alternatives you've considered:
You could of course define a custom function that does the same for you by wrapping the call to render. However, without the hindsight of defining one upfront, if you've already used the barebones render in hundreds of tests before the need for a wrapper, you need to now refactor all of those tests :(
Teachability, Documentation, Adoption, Migration Strategy:
No migration needed as this would be backwards-compatible in terms of the configure API.
- Linguagem predominante
- JavaScript
- Estrelas
- 19.7k
- Forks
- 1.2k
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de testing-library/react-testing-library
-
fireEvent.select does not wrap its automatic native focus in actTalvez já em andamento @sergioperezcheco assumiu há 26 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
bug: calling configure() without reactStrictMode resets it to undefined, silently disabling strict modeTalvez já em andamento @nimbly1 assumiu há 7 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 35/100
testing-library/react-testing-library#1466 · 2 comentários ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
testing-library/react-testing-library#1459 · 2 comentários ·
-
perf: optimize container lookup with early exitTalvez livre de novo @Ch-Abhinav-Chowdary assumiu há 322 dias e não há nenhum pull request aberto. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 35/100
testing-library/react-testing-library#1430 · 1 comentário ·
-
`fireEvent.mouseEnter` does not forward `relatedTarget` (relatedTarget is the window instead)Talvez já em andamento @swarnim02 assumiu há 340 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
Todas as issues de testing-library/react-testing-library
Issues semelhantes
-
needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
microsoft/playwright#43875 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Run the dependency drift checkTalvez já em andamento @spaceninja assumiu hoje. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
cloudfour/stylelint-config-cloudfour#683 ·
Mantenedores costumam responder em até 1 dia
-
Documentation Enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
JSPrismarine/JSPrismarine#2706 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
PostHog/posthog-js#5524 ·
Mantenedores costumam responder em até 2 dias
-
enhancement good first issue help wanted
Dificuldade 2/5 Meio dia Facilidade para iniciantes 66/100
AlphaaCode/Popbook#10 ·