Skip to content

Option to disable prettyPrint #1521

Closed
Closed
@Edhilion

Description

@Edhilion

What problem does this feature solve?

Hello,

I'm migrating to version beta.33 from beta.11 and, if I understand very well the need of a default pretty print for the wrapper.html(), I still don't understand why the option of disabling the pretty print has been removed in 72f10fb, since it could be set as a default parameter value.

In my particular case, I find it really uneasy to read at tests with '\n' and spaces everywhere. I don't care about how the developers have structured the html, I want to know if the elements are here, in the right order, with the right attributes.

A default value will be a richer feature, without breaking the current behaviour.

Thank you for your attention.

What does the proposed API look like?

html(options = { prettyPrint: true }): string {
  if (options.prettyPrint) {
    return pretty(this.element.outerHTML)
  }
return this.element.outerHTML
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions