Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(console-reporter): Generating code snippets on error#2270

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
In1th wants to merge3 commits intoserenity-js:main
base:main
Choose a base branch
Loading
fromIn1th:upstream/feat/code-snippets-on-error

Conversation

@In1th
Copy link
Contributor

@In1thIn1th commentedMar 4, 2024
edited
Loading

@In1th
Copy link
ContributorAuthor

@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)

@jan-molak
Copy link
Member

Hey@In1th - you can use the existingErrorStackParser.
Here's an example ofhow to turn aStackFrame into aFileSystemLocation

ProblemIndication,
}from'@serenity-js/core/lib/model';
import{InstanceasChalkInstance}from'chalk';// eslint-disable-line unicorn/import-style
importtype{FileSystem}from'packages/core/lib/io';
Copy link
Member

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

Copy link
ContributorAuthor

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 😄

Copy link
Member

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 🤔

@In1th
Copy link
ContributorAuthor

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?

@jan-molak
Copy link
Member

jan-molak commentedMar 9, 2024
edited
Loading

I don't see any integration test using console reporter

Console reporter is reasonably simple and doesn't require a separate integration test module.
Have a look atConsoleReporter.spec.ts.

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
Copy link
ContributorAuthor

Ok, I have it!
Screenshot 2024-03-19 at 01 53 02
Though it doesn't have code highlighting, and it's not so smart as playwright's.

Just need ok for this layout, still gotta figure out how to add user path to tests and how to change console reporter static methods to support snippets

jan-molak reacted with heart emoji

@jan-molak
Copy link
Member

@In1th - Looks awesome, great work so far!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@jan-molakjan-molakjan-molak left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@In1th@jan-molak

[8]ページ先頭

©2009-2025 Movatter.jp