Skip to content
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

How to exclude "node_modules" in BuckleScript/Jest project? #309

Closed
jihchi opened this issue Apr 19, 2020 · 2 comments
Closed

How to exclude "node_modules" in BuckleScript/Jest project? #309

jihchi opened this issue Apr 19, 2020 · 2 comments
Labels

Comments

@jihchi
Copy link
Contributor

jihchi commented Apr 19, 2020

Hi and thanks for the great tool!

I'm working on this the draft, trying to switch to bisect ppx from Jest. I am able to generate code coverage report, but the report includes a 3rd-party library:

reazenrelude  Build #165  Coveralls - Test Coverage History   Statistics 2020-04-19 16-21-23(1)

I'm wondering how to exclude 3rd-party libraries under node_modules folder?

@aantron
Copy link
Owner

aantron commented Apr 19, 2020

@jihchi node_modules is actually already excluded, because BuckleScript doesn't apply your bsconfig.json to any of the code that's from a third-party module, in particular, it doesn't apply your project's ppx-flags to node_modules/bs-bastet.

What's happening is that bs-bastet itself also uses Bisect_ppx, so it's also getting instrumented when you run with BISECT_ENABLE=yes. rescript-lang/rescript#3761 will add dev-only ppx-flags, which will allow bs-bastet (and relude) to automatically not depend on Bisect at all when they are installed as third-party packages.

I understood from @bobzhang that rescript-lang/rescript#3761 will be included in the next release of BuckleScript (7.4?), so I suggest we wait until then, instead of trying to implement some workaround.

(Note that we need dev-only ppx-flags apart from any workaround we could implement in Bisect, because we want to make sure that released packages never even try to call Bisect, and thus don't depend on it being installed at all).

Also cc @Risto-Stevcev.

@aantron
Copy link
Owner

aantron commented Apr 21, 2020

Going to close this for now, as it is tracked in BuckleScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants