Open kumar303 opened 6 years ago
The following is an output for a simple (failing) test program. Can you create a simple project that reproduce the problem and share the link? I will be happy to fix it.
Can you create a simple project that reproduce the problem and share the link?
Sure. Here's one:
I started by running yarn
(version 1.9.4) on Node v8.11.4.
After that I ran flow
, which outputs:
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ index.js:4:16
Cannot coerce thing to string because object literal [1] should not be coerced.
1│ /* @flow */
2│
[1] 3│ const thing = {};
4│ console.log(`${thing}`);
5│
6│ exports.thing = thing;
7│
Found 1 error
If I run jest
or jest --config jest.config.js
all I see is this:
PASS ./test_index.js
✓ (2858ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 2.875s
Ran all test suites.
I would expect to see the same Flow errors.
I found the problem. For some reason I had outdated version of flow. I see that the new flow output is changed so I parse the output incorrectly. I will fix it.
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: SyntheticEventI installed with
yarn add --dev jest-runner-flowtype
and addedjest-flowrunner.config.js
to my directory with this content:I ran:
yarn jest --config jest-flowrunner.config.js
but all I get is this output:I expected to see some Flow errors. Any ideas?
config/test.js
is a path to a file in my project. I also tried settingrunner
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