-
Notifications
You must be signed in to change notification settings - Fork 22
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
refactor(format): make the error messages more readable #13
Conversation
to make the badge in readme follow common convention
as it doesn't seem to be affecting the tests??
as rimraf is generic and reusable
add corresponding tests
jsdom as direct dependency doesn't seem to be needed anymore
expect(null).toBeDefined(); // success
Reformat a11y error msg to include total num of issues, unicode chars to represent a11y issue & help url, rearrange error msg fields, add jest matcher helper to include more info about received vs actual
docs(rules): add readme information with details about the rules included in each pre-config ruleset
Looks like I missed some lint errors. Although the pre-commit hook ran the linter on changes, looks the whole picture got missed. Working on fixing them. |
Looks like the issue was a last minute update to dependencies I did after I created the PR π€¦ - which caused bunch of eslint packages to be updated - which seems to have added/changed some checks. Reverted those updates for now which fixed those errors - will investigate the eslint updates in next PR. But now the build is failing with Jest snapshot errors saying they are not up-to-date - but the updated snapshots have been checked in and the tests pass locally after a clean build. Even checked out the branch to a diff clean location in my machine and tried out the CI commands - no issues π @trevor-bliss Have you encountered this issue with Jest snapshots in CI ? |
@mohanraj-r I'm not exactly sure what's going on here... My only guess is it's something to do with the unicode characters. Maybe Jest is getting confused with the βsymbol. |
To test maybe try stripping the βsymbol and any other special characters before taking the snapshot? Only other thing I can think of right now is the CI might be doing some weird caching? I'm not too familiar with github CI. |
packages/format/src/format.ts
Outdated
const helpURL = violation.helpUrl.split('?')[0]; | ||
return ( | ||
// TODO: Create a formatter specifically for Jest using printReceived etc? | ||
printReceived(`β (${violation.id}) ${violation.help}: ${selectors}`) + |
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.
Feels a little weird to me to call this Jest matcher API here. I would think the Jest specific APIs would only be called in the matcher package.
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.
Agree, was thinking similar. Will try to refactor.
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.
@trevor-bliss refactored to remove the jest specific matchers to be passed from jest package
This reverts commit 6e73cd6.
move func to get num of issues from matcher to format
to check if it fixes #14
to check if it fixes #14
check if this fixes #14
This reverts commit dfc39c1. # Conflicts: # packages/assert/__tests__/__snapshots__/assert.test.ts.snap # packages/format/__tests__/__snapshots__/format.test.ts.snap # packages/jest/__tests__/__snapshots__/matcher.test.ts.snap
This reverts commit 72c5e28. # Conflicts: # packages/jest/__tests__/__snapshots__/matcher.test.ts.snap
β¦ hint" This reverts commit 44fbfc0.
revert workarounds tested for #14
for consistency with build step
check if the snapshot errors could be related to OS #14
β¦into refactor_formatter
This reverts commit fc5c181.
to use docker image tag and new syntax
as there is only 1 matcher and adding sa11y name to make it easily identifiable
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.
Refactor formatter to
?application=axeAPI
referral from Help URLsPrimary changes in
Other changes:
registerA11yMatchers
toregisterSa11yMatcher
After this PR is merged, I will publish the packages to npm.
Before
After
Screenshot:
![image](https://user-images.githubusercontent.com/1509984/83563168-97c9ed00-a4cf-11ea-8b0b-0cb50ca046a4.png)