Kotest: Provide a way to remove test prefixes in the test output when using specs which use prefixes

Created on 4 Jun 2020  路  5Comments  路  Source: kotest/kotest

When using DescribeSpec, the test output when running tests adds the prefix Describe: before any nesting and additionally It: in the Kotest plugin window for the tests themselves.

Providing a way to get rid of these prefixes would reduce clutter in the test output.

Example:

Test code:

describe("emitting events") {
  describe("when multiple event listeners are subscribed")
    it("notifies event listeners in the same order they were added")
}

Current test output

Describe: emitting events
  - Describe: when multiple event listeners are subscribed
    - notifies event listeners in the same order they were added

Desired test output

emitting events
  - when multiple event listeners are subscribed
    - notifies event listeners in the same order they were added
framework Good First Issue enhancement

All 5 comments

In the meantime you can use freespec to have arbitrarily nested blocks without prefixes.

In 4.2 we'll provide a flag to allow prefixes of any kind (Describe, Expect, Feature, and so on) to be omitted in the output.

The more I think about this, the more I want to just get rid of the Describe prefixes. @Kerooker @ashishkujoy thoughts on me making this change for 4.1 ?

Yes @sksamuel I think we can remove this with 4.1

I've added a flag to disable these prefixes, included in 4.1.
Starting 4.2, we'll make the default to hide the prefixes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

phuctm97 picture phuctm97  路  5Comments

myuwono picture myuwono  路  8Comments

jensim picture jensim  路  11Comments

mnonnenmacher picture mnonnenmacher  路  3Comments

r3mi picture r3mi  路  7Comments