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
JS nested tests v2 #3913
base: master
Are you sure you want to change the base?
JS nested tests v2 #3913
Conversation
# Conflicts: # kotest-framework/kotest-framework-engine/src/jsMain/kotlin/io/kotest/engine/spec/createSpecExecutorDelegate.kt
- add more typing to JS externals - add `@KotestInternal` to JS externals - adapt some of the JVM SpecExecutor code to JS execution
The engine changes in this PR would break #3805. |
…ests # Conflicts: # kotest-framework/kotest-framework-engine/src/jsHostedMain/kotlin/io/kotest/engine/PromiseTestCaseExecutionListener.kt # kotest-framework/kotest-framework-engine/src/jsMain/kotlin/io/kotest/engine/externalTestMethods.kt # kotest-framework/kotest-framework-engine/src/jsMain/kotlin/io/kotest/engine/spec/createSpecExecutorDelegate.kt
Not a review at this time, but results from experimenting with the code. Thank you for getting it to this stage! For browser-based JS, results look good already. Also works partially on Node.js and Wasm, yet some challenges remain. How I tested
Observations
Suggestions before proceeding with a review
|
A continuation of #2957 - full credits to @benkuly for the original PR!
This PR updates #2957 with the latest changes from master. I've tested this locally by publishing Kotest to MavenLocal and checking it in a project, and it seems to work.
Slack thread: https://kotlinlang.slack.com/archives/CT0G9SD7Z/p1709829959811199
Fix #3141
Details
The problem: I believe that JS Test Frameworks first run all contexts to discover them, and then execute the tests. This is in contrast to Kotest, which will execute tests as they are discovered, and this prevents JS Test Frameworks from discovering tests that are defined later.
Workaround
As a workaround Kotest will concatenate the contexts with an arrow:
Discussions
Discussions have mostly been taking place in
#kotest
in the Kotlin Slack. If you'd like to get involved, feel free to join us on Slack, or to leave a comment here on GitHub!