-
Notifications
You must be signed in to change notification settings - Fork 253
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
feat: move from mocha to jest #572
Conversation
de8dd60
to
bb99d15
Compare
I personally have no interest in this so I'm +0. But if it helps you move easier, I don't mind the switch. I could also argue about some of the pros you list, but none of us will benefit from this ;) Bottom line, I don't mind moving to Jest, but this PR is far from ready AFAICT. EDIT: FYI this is my personal favorite https://github.com/lukeed/uvu which I use when I can to replace mocha. |
Yeah I just wanted to draw your attention to this and to get your opinion. Thanks for reply I'll move forward with this. |
JEST
MOCHA
Jest Coverage (native)
Jest coverage (c8)
Mocha Coverage (с8)
NOTE: shape.test.jest.js was changed because of mocking the results, and thus getting rid of obsolete tests |
@Kreeg when you are ready let me know so that I can have a closer look :) |
BTW one things that bothers me on main is that after running each test file, the tmp folder is cleaned. So, if one test suite fails, I have to explicitly run the failed one again so that I can get the updated PNG files from tmp. I think we should clear the tmp folder via cli or just don't clear it at all. |
@XhmikosR Ok I'll tell you when it is ready |
No worries, we'll check it out again later :) |
@XhmikosR Hey! The first step is done. I kept old test files for visual comparing with the new ones and to have ability to run old tests. |
@Kreeg I think these only are left:
They are not blocking of course, it's just nice to have before we land this huge PR :) I also have a question about the coverage but I'm not sure if it's a misconfiguration issue. I see duplicate files in Again, great work! |
I'll check later issue with coverage. |
Re 1., 2. all good now :) About 3., it's not new it's the same issue we had in the past. 15s might work better. |
@XhmikosR yeah |
@XhmikosR so it's ready now |
About coverage folders. The files are not quite the same. I think it's jest "feature". Is it a problem? |
Great, let's land it and we can tweak it later!
|
Not a problem, it just confuses me, personally. I mean, which one is the "right" one? |
I'm not sure which is correct too. I think they are all correct, but looks different (some files are not present in lcov directory) |
Can you make a branch adding your preferred prettier options but trying to match the current style? Assuming we have a prettier config file, we should be able to make use of it in the whole codebase and for JS we can use xo + prettier. |
@XhmikosR OK! But I think to match all this styles with prettier is impossible but I'll try |
Yeah, we'll need to adapt some things for sure but it should be doable :) |
Pros:
npm run coverage:jest
andnpm run coverage:jest:native
). Bye c8.should
,assert
)jest --watch
Cons:
TODO:
Fixes #445 along the way