Skip to content

Commit

Permalink
Updated docs for project config to specify class except on JVM and JS #…
Browse files Browse the repository at this point in the history
  • Loading branch information
sksamuel committed Mar 10, 2024
1 parent 85e4d1f commit 83e5653
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion documentation/docs/framework/project_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Kotest is flexible and has many ways to configure tests, such as configuring the
test classes are created. Sometimes you may want to set this at a global level and for that you need to use
project-level-config.

Project level configuration can be used by creating an object or class that extends from `AbstractProjectConfig`.
Project level configuration can be used by creating a class that extends from `AbstractProjectConfig`.
Note: On the JVM and JS platforms, an object is also supported if you prefer to a class.

Any configuration set at the Spec level or directly on a test will override the config specified at the project level.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ import kotlin.time.Duration
* Project-wide configuration. Extensions returned by an instance of this class will be applied
* to all [Spec]s and [TestCase][io.kotest.core.test.TestCase]s.
*
* Create an object or class that is derived from this class and place it in your source.
* Create a class that is derived from this class and place it in your source.
* Note, on the JVM and JS, this config class can also be an object.
*
* It will be detected at runtime and used to configure the test engine.
*
* For example, you could create this object and place the source in `src/main/kotlin/my/test/package`.
*
* ```
* object KotestProjectConfig : AbstractProjectConfig() {
* class KotestProjectConfig : AbstractProjectConfig() {
* override val failOnEmptyTestSuite = true
* override val testCaseOrder = TestCaseOrder.Random
* }
Expand Down

0 comments on commit 83e5653

Please sign in to comment.