-
Notifications
You must be signed in to change notification settings - Fork 0
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 test utils #9
Conversation
In webpack+karma, we would alias |
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.
This looks good
It looks good to me, I wonder if the test suite will be noticeably faster? |
45e024e
to
bb8f5df
Compare
This should include docs on usage. |
Codecov Report
@@ Coverage Diff @@
## master #9 +/- ##
==========================================
+ Coverage 83.03% 83.45% +0.42%
==========================================
Files 17 18 +1
Lines 501 532 +31
Branches 150 167 +17
==========================================
+ Hits 416 444 +28
- Misses 71 73 +2
- Partials 14 15 +1
Continue to review full report at Codecov.
|
40569fc
to
4bc1a48
Compare
Adds test utils which stub out all
entities
-wrapped components.This is easily implemented in either jest or karma+webpack.
The new export has functions:
entities.mock(componentName: string, propsToProvide: {})
Whenever a component namedcomponentName
is encountered, it will be given thepropsToProvide
as props instead of wrapping with redux.entities.stub
isentityStub
from the frontend app.entities.reset
resets the stubs.entities
is the fake HOCThis allows you to write tests like this:
MyComponent.js
MyOtherComponent
MyOtherComponent.spec.js