Hi Kotest-ers :slightly_smiling_face: Today I've s...
# kotest
g
Hi Kotest-ers 🙂 Today I've seen a weird (at least to me) usage of
beforeTest/afterTest
, as follows, at
context
level.
Copy code
ShouldSpec {
   beforeTest {
          ...
   }

   afterTest {
           ...
   }

   context("context) {
      beforeTest {
          ...
      }

      should() {
          ...
      }
      
      afterTest {
           ...
      }
    }
}
TBH honest I didn't know it was possible... Have I missed something in the documentation? gratitude thank you
s
you can do that, but probably makes your tests complicated to follow
g
So it allows setting up common things only for the given context. I didn't know it was possible. But I see your point about the perceived complexity nod 🙂