Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for nested tests on Kotlin/Native #2453

Closed
Tracked by #2226
charleskorn opened this issue Sep 2, 2021 · 3 comments · Fixed by #2470
Closed
Tracked by #2226

Support for nested tests on Kotlin/Native #2453

charleskorn opened this issue Sep 2, 2021 · 3 comments · Fixed by #2470
Labels
enhancement ✨ Suggestions for adding new features or improving existing ones. framework 🏗️ Pertains to the core structure and components of the Kotest framework. multiplatform 🌐 This label is designated for issues and pull requests that concern the Kotest framework's compatibil
Milestone

Comments

@charleskorn
Copy link
Contributor

At the moment, attempting to use any kind of nested test fails on Kotlin/Native targets with an exception:

kotlin.IllegalStateException: Spec styles that support nested tests are disallowed in kotest-js and kotest-native due to restrictions in the platforms. Please use FunSpec, StringSpec, or ShouldSpec and ensure that nested contexts are not used.

Being able to nest tests is one of the compelling features of kotest over the built-in kotlin.test framework. What would it take to support this?

@charleskorn charleskorn added the enhancement ✨ Suggestions for adding new features or improving existing ones. label Sep 2, 2021
@sksamuel
Copy link
Member

sksamuel commented Sep 2, 2021

On native, it will be included in 5.0 if possible, it shouldn't be difficult.
On JS it's not possible without changing Kotest in breaking ways.

@sksamuel sksamuel added this to the 5.0 milestone Sep 2, 2021
@sksamuel sksamuel added framework 🏗️ Pertains to the core structure and components of the Kotest framework. multiplatform 🌐 This label is designated for issues and pull requests that concern the Kotest framework's compatibil labels Sep 2, 2021
@sksamuel sksamuel mentioned this issue Sep 2, 2021
71 tasks
@sksamuel
Copy link
Member

sksamuel commented Sep 7, 2021

@charleskorn try snapshot 471.
The output isn't amazing because the intellij format lacks real nested support but it works.

@sksamuel sksamuel closed this as completed Sep 7, 2021
@charleskorn
Copy link
Contributor Author

Awesome, thanks @sksamuel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ Suggestions for adding new features or improving existing ones. framework 🏗️ Pertains to the core structure and components of the Kotest framework. multiplatform 🌐 This label is designated for issues and pull requests that concern the Kotest framework's compatibil
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants