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

FunSpec contexts disable all tests with test-case config in 5.0.1 #2710

Closed
Jadarma opened this issue Dec 4, 2021 · 2 comments
Closed

FunSpec contexts disable all tests with test-case config in 5.0.1 #2710

Jadarma opened this issue Dec 4, 2021 · 2 comments
Labels
bug 🐛 Issues that report a problem or error in the code. framework 🏗️ Pertains to the core structure and components of the Kotest framework.
Milestone

Comments

@Jadarma
Copy link

Jadarma commented Dec 4, 2021

Kotest 5.0.1

When using FunSpec in 5.0.1, any test that uses the .config within a context will be disabled, regardless of passed enabled parameter.
I tired to test the same behaviour with ShouldSpec, but it does not manifest itself there.
Reverting the Kotest version to 4.6.3 fixes this issue, perhaps it is a regression?

Minimum steps to reproduce:

class DisabledTest : FunSpec({
    test("Will be enabled") {}
    test("Will be enabled also").config {}
    test("Will be correctly disabled").config(enabled = false) {}
    context("A context will disable tests using test.config") {
        test("Will be enabled") {}
        test("Will be disabled, but shouldn't").config {}
        test("Will be disabled also, but shouldn't").config(enabled = true) {}
        test("Will be disabled but might be coincidental").config(enabled = false) {}
    }
})
@sksamuel sksamuel added this to the 5.0.2 milestone Dec 7, 2021
@sksamuel sksamuel added bug 🐛 Issues that report a problem or error in the code. framework 🏗️ Pertains to the core structure and components of the Kotest framework. labels Dec 7, 2021
sksamuel pushed a commit that referenced this issue Dec 8, 2021
…2715)

* Fixes fun spec with context having config getting disabled.

* Adds test to verify fun spec with config inside a context block is not disabling the test

* Update comment

* Adds some more combinations of enable and disable tests
@sksamuel
Copy link
Member

sksamuel commented Dec 8, 2021

Thanks for bug report, we'll get 5.0.2 out next day or so.

@sksamuel sksamuel closed this as completed Dec 8, 2021
@sksamuel
Copy link
Member

sksamuel commented Dec 8, 2021

(Fixed in master)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Issues that report a problem or error in the code. framework 🏗️ Pertains to the core structure and components of the Kotest framework.
Projects
None yet
Development

No branches or pull requests

2 participants