-
-
Notifications
You must be signed in to change notification settings - Fork 425
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
fix: Fix unicode symbols compatibility on Windows #248
Conversation
Replace emojis with symbols from `log-symbols`
I think it's better to wait for #242 to be merged first |
Don't worry about it. You can go ahead with this. I'll rebase and do the required changes. |
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.
LGTM
cool! But only @okonet who can force merge this |
@@ -32,7 +33,7 @@ describe('runScript', () => { | |||
try { | |||
await res[0].task() | |||
} catch (err) { | |||
expect(err.message).toMatch(`🚫 test got an unexpected error. | |||
expect(err.message).toMatch(`${logSymbols.error} test got an unexpected error. |
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.
Should we switch to http://facebook.github.io/jest/docs/en/expect.html#tothrowerrormatchingsnapshot 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.
agree! do it in this PR or on separate PR?
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.
Just a note, there are some jest
related things which aren't optimum. Example - https://github.com/okonet/lint-staged/blob/33a7a4ae6a89603eb929ffe70e3900021a78f307/test/__mocks__/npm-which.js#L1-L14
This isn't using jest.genMockFromModule
correctly.
Docs - http://facebook.github.io/jest/docs/en/jest-object.html#jestgenmockfrommodulemodulename
Guide - http://facebook.github.io/jest/docs/en/manual-mocks.html
Another example for less optimal assertion - https://github.com/okonet/lint-staged/blob/33a7a4ae6a89603eb929ffe70e3900021a78f307/test/runScript-mock-pMap.spec.js#L21-L25
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.
@luftywiranda13 doesn't matter to me TBH.
@sudo-suhas could you help with those examples and create a PR that would "fix" them before this one is merged?
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 am a bit swamped at the moment. Trying to finish something at work. I can do it tomorrow. I think I'd prefer optimising jest related things in a separate PR after all the changes I have in the pipeline:
- eslint-plugin-lodash
- fix failing tests on windows
- rebase dedent PR
getConfig
-_normalized
property- try pify
edit: 'fix failing tests on windows' takes highest priority. I actually can't run tests for my changes otherwise. And gotta make it all green 😄
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.
+1 on pify 👍
@@ -146,7 +147,7 @@ describe('runScript', () => { | |||
await taskPromise | |||
} catch (err) { | |||
expect(err.message) | |||
.toMatch(`🚫 mock-fail-linter found some errors. Please fix them and try committing again. | |||
.toMatch(`${logSymbols.error} mock-fail-linter found some errors. Please fix them and try committing again. |
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.
Same here: Should we switch to http://facebook.github.io/jest/docs/en/expect.html#tothrowerrormatchingsnapshot instead
Let's wait with merging this one until appveyor integration is green. |
Codecov Report
@@ Coverage Diff @@
## master #248 +/- ##
==========================================
+ Coverage 90.12% 90.18% +0.06%
==========================================
Files 10 10
Lines 162 163 +1
Branches 23 23
==========================================
+ Hits 146 147 +1
Misses 15 15
Partials 1 1
Continue to review full report at Codecov.
|
I tested this out using |
I'm gonna merge this one. If you find issues, please report them separately. |
Replace emojis with symbols from
log-symbols
Closes: #247 #248