jest-runner-flowtype icon indicating copy to clipboard operation
jest-runner-flowtype copied to clipboard

The README doesn't have an example of normal operation

Open kumar303 opened this issue 5 years ago • 3 comments

I'd like to try this out for my project but it doesn't seem to work and I'm not even sure what to look for. What does normal operation look like? It would help if the README had an example.

To test things, I broke my code so that flow --colors=always in my root directory outputs some errors.

Flow output
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/amo/components/AddonReviewCard/index.js:102:57

Cannot get review.id because:
 • property id is missing in undefined [1].
 • property id is missing in null [2].

 [1][2]  51│   review?: UserReviewType | null,
           :
         99│     event.preventDefault();
        100│
        101│     //invariant(review, 'review is required');
        102│     dispatch(cancelDeleteAddonReview({ reviewId: review.id }));
        103│   };
        104│
        105│   onClickToDeleteReview = (event: SyntheticEvent<HTMLElement>) => {



Found 2 errors

I installed with yarn add --dev jest-runner-flowtype and added jest-flowrunner.config.js to my directory with this content:

module.exports = {
  runner: "jest-runner-flowtype"
};

I ran: yarn jest --config jest-flowrunner.config.js but all I get is this output:

yarn run v1.9.4
$ /Users/kumar/dev/addons-frontend/node_modules/.bin/jest --config jest-flowrunner.config.js
 PASS  config/test.js
  ✓  (157ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.175s, estimated 1s
Ran all test suites.
✨  Done in 0.81s.

I expected to see some Flow errors. Any ideas? config/test.js is a path to a file in my project. I also tried setting runner in my existing config but, still, I didn't see a report of Flow errors. The output was different.

Node version: v8.11.4 Flow version: 0.83.0 Jest version: 23.1.0

kumar303 avatar Oct 11 '18 21:10 kumar303