- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Help with BuckleScript and bs-jest #307
Comments
@wyze What commands are you running to test with coverage? Can you show them? Are you including |
Thanks for taking a look. I just pushed a branch of me attempting to get it to work. https://github.com/wyze/bs-react-testing-library/tree/bisect_ppx Yes, I added that env variable before |
Could you please give the exact commands you enter at the terminal to try to get coverage on that branch? |
I use |
I patched like this to get a coverage report: --- a/src/__tests__/ReactTestingLibrary_test.re
+++ b/src/__tests__/ReactTestingLibrary_test.re
@@ -1,6 +1,6 @@
open Jest;
-Bisect.Runtime.write_coverage_data_on_exit();
+afterAll(Bisect.Runtime.write_coverage_data);
module Greeting = {
[@react.component] It seems that Jest isn't triggering You may also want to add |
Awesome! I should have tried those hooks! Yes I will add the things to .gitignore. Now I can switch my Reason projects to Codecov! I don't mind doing a PR to update the readme and the bsb-starter-project with extra instructions for bs-jest. |
I suppose one way to do this in projects with multiple test files would be to ask users to do afterAll(() => {
Bisect.Runtime.write_coverage_data();
Bisect.Runtime.reset_counters();
}); in each test file. |
Great :) Regarding
I would be happy to merge such a PR :) |
Perhaps |
It does look like there is this, https://jestjs.io/docs/en/configuration#globalteardown-string, but it is all JS so not sure if that would work for you. |
Thanks! It looks complicated enough that I'll keep it as a note until someone genuinely needs Bisect to support that. |
So, I went and tried the same setup in another project, but when running with my CI: https://github.com/wyze/bs-jest-dom/pull/13/checks?check_run_id=581289039 |
That's almost certainly an issue with Bisect_ppx not respecting the special meaning of |
See aantron/bisect_ppx#307 (comment). [skip ci]
I updated the README with instructions to use |
Hello and great project!
This is more of a help request than an issue, but I am trying to get coverage report to work when running tests via bs-jest.
Nothing is outputted when following the BuckleScript documentation. However if I add the
Bisect.Runtime.write_coverage_data_on_exit();
line inside the module (not tests), and build and run the filenode file.bs.js
I do get output, but the coverage is at 0%.Any help is greatly appreciated, and you can checkout the project I am trying it on here: https://github.com/wyze/bs-react-testing-library
The text was updated successfully, but these errors were encountered: