Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Add file and speed test properties#52

Open
dorny wants to merge 1 commit intomocha-community:masterfrom
dorny:add-file-and-speed-props
Open

Add file and speed test properties#52
dorny wants to merge 1 commit intomocha-community:masterfrom
dorny:add-file-and-speed-props

Conversation

@dorny
Copy link
Copy Markdown

@dorny dorny commented Mar 8, 2021

This PR adds file and speed properties on test object.

  • file was added to json reporter in mocha v7.2.0
  • speed was added to json reporter in mocha v8.2.0

I actually tested with even older version of mocha and looks like the properties are available there.

Backstory:
I'm adding mocha support to test-reporter.
Thought it would be nice to have both the console spec reporter output and json report at same time. JSON report would be then processed by test-reporter. Found out it's possible only with mocha-multi-reporters and json-file-reporter. Unfortunately not having file property on test object is a blocker for me.

@ryanrishi
Copy link
Copy Markdown

Thanks @dorny! I'm encountering the same issues using mocha-multi-reporters, writing Mocha results to stdout (via spec) and a file (via json-file-reporter). Unfortunately I can't use Github actions to publish the JSON results because the JSON results don't have a file property.

This PR looks like it will fix this use case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants