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
feat(console-reporter): Generating code snippets on error #2270
base: main
Are you sure you want to change the base?
feat(console-reporter): Generating code snippets on error #2270
Conversation
@jan-molak I did a base version, but I have to ask you - are stack format library independent? Because if that's not the case, then we need parser for every one of them. (also you tried to chat with me on serenity chat, but there were some encryption issue) |
Hey @In1th - you can use the existing |
@@ -30,10 +30,12 @@ import { | |||
ProblemIndication, | |||
} from '@serenity-js/core/lib/model'; | |||
import { Instance as ChalkInstance } from 'chalk'; // eslint-disable-line unicorn/import-style | |||
import type { FileSystem } from 'packages/core/lib/io'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want @serenity-js/core/lib/io
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I noticed vs code is not doing great with this repo 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what causes it 🤔
Ok I have done some refactoring and added a flag to add tests for snippets, but I don't see any integration test using console reporter. Should I add a new integration test project for that or did I miss anything? |
Console reporter is reasonably simple and doesn't require a separate integration test module. The best way to test it is to pump a stream of events into it and then assert on the output. To generate a stream of events you can:
Since the events generated by all the test runners are identical, we don't need to test the console reporter with each test runner, just with the events. |
@In1th - Looks awesome, great work so far! |
#2244