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

Provide a way to remove test prefixes in the test output when using specs which use prefixes #1486

Closed
Reevn opened this issue Jun 4, 2020 · 5 comments
Assignees
Labels
enhancement ✨ Suggestions for adding new features or improving existing ones. framework 🏗️ Pertains to the core structure and components of the Kotest framework. good-first-issue 👶 Suitable for newcomers looking to contribute to the project.
Milestone

Comments

@Reevn
Copy link
Contributor

Reevn commented Jun 4, 2020

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
@LeoColman LeoColman added enhancement ✨ Suggestions for adding new features or improving existing ones. framework 🏗️ Pertains to the core structure and components of the Kotest framework. good-first-issue 👶 Suitable for newcomers looking to contribute to the project. labels Jun 4, 2020
@sksamuel
Copy link
Member

sksamuel commented Jun 6, 2020

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

@sksamuel sksamuel added this to the 4.2 milestone Jun 7, 2020
@sksamuel sksamuel changed the title Provide a way to remove "Describe:" prefix in the test output when using DescribeSpec Provide a way to remove test prefixes in the test output when using specs which use prefixes Jun 7, 2020
@sksamuel
Copy link
Member

sksamuel commented Jun 7, 2020

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.

@sksamuel
Copy link
Member

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 ?

@ashishkujoy
Copy link
Contributor

Yes @sksamuel I think we can remove this with 4.1

@sksamuel sksamuel modified the milestones: 4.2, 4.1 Jun 12, 2020
@sksamuel sksamuel self-assigned this Jun 12, 2020
@sksamuel sksamuel mentioned this issue Jun 12, 2020
33 tasks
sksamuel added a commit that referenced this issue Jun 12, 2020
 (#1507)

* Added TestName abstraction; better handling of test scope prefixes #1486
@sksamuel
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ Suggestions for adding new features or improving existing ones. framework 🏗️ Pertains to the core structure and components of the Kotest framework. good-first-issue 👶 Suitable for newcomers looking to contribute to the project.
Projects
None yet
Development

No branches or pull requests

4 participants