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

Open
#514 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
kotlin
Domain
testing

Research direction

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.

Written by the indexing model from the issue text.

Description

enhancement jvm

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.

Dominant language
Kotlin
Stars
101
Forks
18
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from diffplug/selfie

All issues in diffplug/selfie

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.