question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide support for adding config at higher level in case of nested test

See original GitHub issue

This question has been asked on stackoverflow.

As of now we can add config to the lowest level/leaf test of nested test for example

class MyTest : FreeSpec({
 "high level container with multiple tests" - {
    "always failing test".config(enabled: false) { // config at lowest level or leaf
        fail("Should not get called")
    }

   "another always failing test".config(enabled: false){ // config at lowest level or leaf
        fail("Should not get called")
    }
  }
})

we should have ability to provide config at higher level/container as well for example

class MyTest : FreeSpec({
 "high level container with multiple tests".config(enabled: false) - { // config at top level/container
    "always failing test" {
        fail("Should not get called")
    }

   "another always failing test" {
        fail("Should not get called")
    }
  }
})

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sksamuelcommented, Apr 25, 2020

Maybe, but it would have to be a cut down version of config - without invocations / threads. So we could have ContainerTestConfig which has enabled, enabledIf, tags.

0reactions
sksamuelcommented, Aug 23, 2020

We can now use timeouts at a higher level. We can disable using ! at a higher level. And tags have always been supported at a higher level. I think this is good to close.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JUnit 5 Nested Class: @Nested Tutorial With Examples
The high-level answer to this is that the complex and multiple test cases can be broken down in such a way that each...
Read more >
NoSuchBeanDefinitionException if a @Bean is needed in a ...
I declared a static class on the top level of the test class. ... but why do the nested classes not know anything...
Read more >
Allow @Nested test classes to be ordered #2699 - GitHub
When having a @TestMethodOrder annotated class, I'd like to not only be able to annotate @Test methods, but also be able to define...
Read more >
JUnit 5 Tutorial: Writing Nested Tests - Petri Kainulainen
This blog post describes how we can write nested tests with JUnit 5. ... Next, we will add nested setup, teardown, and test...
Read more >
Organize Pega unit tests with nested test suites
A test suite can now contain both test cases and other test suites. Additionally, test suites within a top-level test suite support further ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found