-
Notifications
You must be signed in to change notification settings - Fork 3
[Fixes #19] Add Jest #23
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for this! Looking great so far 😄
@@ -56,9 +55,8 @@ | |||
"eslint-plugin-jsx-a11y": "^6.0.2", | |||
"eslint-plugin-react": "^7.4.0", | |||
"fluent-react": "^0.8.1", | |||
"istanbul": "^1.0.0-alpha", | |||
"jest": "^23.6.0", |
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.
so much cleaner, love it.
</Localized> | ||
); | ||
assert(wrapper.contains(expectedOutput)); | ||
expect(wrapper).toMatchSnapshot(); |
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 do kind of like the simple expectedOutput
as a visual of what this component looks like. The snapshots themselves are hard to read. I think it's a reasonable tradeoff, though, for the thoroughness and simplicity of the test code.
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 could go either way here, honestly.
import { pseudolocalize } from '../src'; | ||
|
||
describe('pseudolocalize', () => { | ||
it('should transform a message', () => { | ||
it.only('should transform a message', () => { |
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.
careful about leaving these in.
Is there a linting rule or similar to prevent accidentally merging this in to master?
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.
D'oh! :shame:
There is a linting rule. I will find it and add.
RFC: Putting this up to get feedback on the approach before copying it to the
extraction
package.