Skip to content

[💡 Feature]: add code executed as a string into onTestxxx hooks (for usage in reporter) #8759

@talbss

Description

@talbss

Is your feature request related to a problem?

Coming from protractor + mocha + mochawesome reporter.
The reporter offers the possibility to include function body code into reporter for better readability (test result + code + screenshot for each test).

https://github.com/mochajs/mocha/blob/ac43029d6a86150a48ccd59e50e89ca10c72a9c0/lib/runnable.js#L37
https://github.com/mochajs/mocha/blob/ac43029d6a86150a48ccd59e50e89ca10c72a9c0/lib/test.js#L99

Describe the solution you'd like.

I would like to have a key named code in testStats object argument for all onTestxxx hooks (when applicable) allowing to includes the code exectuted by the test into the reporter.

Describe alternatives you've considered.

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementIdea 💡A new feature ideahelp wantedIssues that are free to take by anyone interested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions