diffplug / diffplug/selfie

Remove requirement to not have "/" in test names? (Junit 5)

Aperta
#514 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
enhancement jvm
Lingua principale
Kotlin
Stelle
101
Fork
18
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Fantastic tool, thank you! I only hit a little snag: in my project I already have many Kotest/Junit5 units named after HTTP endpoints such as `GET /example`, and I'm hitting this error:

```
Caused by: java.lang.IllegalStateException: Test name cannot contain '/', was ...
at com.diffplug.selfie.junit5.SnapshotFileProgress.startTest(SnapshotSystemJUnit5.kt:188)
```

This happens for every test even though they do not invoke Selfie for snapshots. Could this requirement be loosened somehow? For example:

* Escape the resulting name of snapshot files to remove the slash
* Do not run this check in tests that do not make use of Selfie

Thank you.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start at SnapshotSystemJUnit5.kt:188, where SnapshotFileProgress.startTest rejects test names containing '/'. Reproduce the issue with a JUnit 5 test named like `GET /example`, then determine whether the check should be relaxed or limited to tests using Selfie. Done means such test names no longer fail unnecessarily while snapshot file names remain valid.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
kotlin
Ambito
testing
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.