Tests that keep passing when the code they cover is broken
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- bash, react, typescript
- Domínio
- testing-qa
Direção de pesquisa
Comece com test/auth.test.tsx e as instâncias vinculadas a #779, #782, #785 e #766; execute os testes relevantes e revise isoladamente as mutações deliberadas descritas. Considera-se concluído quando uma convenção acordada para validar testes que protegem contra falhas, incluindo verificações de mutações isoladas, estiver documentada, ou quando for registrado se vale a pena avaliar o Stryker.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Several checks in this repo have turned out to pass whether or not the thing they name works. They were found one at a time during review, so this issue collects them and proposes a convention.
A test that asserts nothing is worse than a missing one, because it reads as coverage.
Instances, and who verified each
The code never executes. In test/auth.test.tsx, a test rendered <AuthCheck> while beforeEach had signed the user out, so the fallback rendered, UserDetails never mounted, and its two expect calls never ran. Armando re-confirmed on v5 by putting an assertion that cannot pass inside UserDetails: the suite still went green. Fixed in #782.
The test passes when the thing it names is broken. Three, all confirmed by mutation:
- The
initialDatabranch ofgetServerSnapshotwas dead under test. Neuter it to always returnloadingand all 22 tests still passed. Found by Armando on #779, which is still open. does not show a logged-out user after navigating awaysits indescribe('useUser')but stopped callinguseUserwhen #782 replaced its wrapper. MakinguseUserthrow left it passing on that branch while the same mutation failed it onv5. Fixed in #782.- The packed-artifact load check only exercised
import(). Breaking therequire()half deliberately left every test green. Found on #766. That code has since been removed from the PR, so this one never landed.
The harness cannot report a failure at all. The flake probe ran its test command under bash -e without a set +e guard, so the first failing iteration killed the step before the result was recorded. It could only ever produce a clean table, and the first run that genuinely reproduced the flake would have reported least. Fixed in #785.
The test catches a mutation for the wrong reason. On the startWithValue removal branch, a test appeared to catch a deliberate break but passed under that same mutation when run in isolation: the failure came from another test's warning in the shared suite. It would have surfaced as an order-dependent CI flake.
What would catch these
A convention rather than a framework: any test whose purpose is to guard a specific failure should be shown to fail against a deliberate break of that failure, and the PR should say so. That is what caught four of the five above, and it costs one run.
Two caveats worth stating. Mutating in the suite is not enough on its own, since coupling between tests can produce the failure for an unrelated reason, so run the mutation in isolation as well. And this only covers tests written deliberately as guards; it says nothing about coverage that quietly evaporates when a wrapper changes, which is what happened in #782.
If we want a tool rather than a convention, mutation testing is off-the-shelf for TS (Stryker), and that is worth pricing before writing anything bespoke.
- Linguagem predominante
- TypeScript
- Estrelas
- 3.6k
- Forks
- 402
- Merge médio
- 2d 18h
- PRs com merge (30d)
- 17
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 FirebaseExtended/reactfire
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 38/100
FirebaseExtended/reactfire#801 ·
Mantenedores costumam responder em até 2 dias
-
v5
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
FirebaseExtended/reactfire#793 ·
Mantenedores costumam responder em até 2 dias
-
v5
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
FirebaseExtended/reactfire#790 · 2 comentários ·
Mantenedores costumam responder em até 2 dias
-
v5
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
FirebaseExtended/reactfire#789 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
FirebaseExtended/reactfire#784 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de FirebaseExtended/reactfire
Issues semelhantes
-
[BUG] rag: sentence content can cross the reported sentence boundariesTalvez já em andamento @LJK-ikun assumiu hoje. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
bug needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
README: the Resource URI Schemas example's file://documents/* pattern only matches that literal URIAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
platformatic/mcp#361 ·
Mantenedores costumam responder em até 1 dia
-
frontend
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Push: sem service worker ou sem VAPID, o interruptor de Notificações fica ligado sem avisar nadaAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
melgarafael/DeskcommCRM#3164 ·
Mantenedores costumam responder em até 1 dia