Skip to content
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

Add example description to JS warnings #42

Merged
merged 1 commit into from
Oct 4, 2023
Merged

Conversation

JunichiIto
Copy link
Contributor

Output example:

WARN: javascript warning in "displays tooltip" (./spec/system/my_awesome_spec.rb:101)
http://127.0.0.1:53186/packs-test/js/application-1237f3764f27da97575a.js 125177:12 "[BootstrapVue warn]: tooltip - The provided target is no valid HTML element."

@@ -27,7 +31,8 @@ def failure_message
end

def have_no_js_errors
JsNoErrorMatcher.new
example_description = self.inspect.split(' ', 2).last.chop
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"#<RSpec::ExampleGroups::Nested::Nested_4::Nested_4 \"displays tooltip\" (./spec/system/my_awesome_spec.rb:101)>"

みたいな文字列から

"\"displays tooltip\" (./spec/system/my_awesome_spec.rb:101)"

だけを抜き出そうとしている。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

後からコード見た時にも何をしているか分かるようにコード上にもコメントを足しておいてほしいです。 🙏

Output example:

```
WARN: javascript warning in "displays tooltip" (./spec/system/my_awesome_spec.rb:101)
http://127.0.0.1:53186/packs-test/js/application-1237f3764f27da97575a.js 125177:12 "[BootstrapVue warn]: tooltip - The provided target is no valid HTML element."
```
@aki77 aki77 merged commit e81c165 into master Oct 4, 2023
3 checks passed
@aki77 aki77 deleted the refine-js-warning branch October 4, 2023 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants