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

Fix bisect ppx #6

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ jobs:

- name: Test
run: make test

- name: Coverage
run: make coverage
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,14 @@ format-check: ## Checks if format is correct
.PHONY: watch
watch: ## Watch for the filesystem and rebuild on every change
$(DUNE) build --watch

.PHONY: test
test: ## Run tests
$(DUNE) test

.PHONY: coverage
coverage: ## Generate coverage report in _coverage folder
$(DUNE) clean
BISECT_ENABLE=yes $(DUNE) build
$(DUNE) runtest
opam exec -- bisect-ppx-report html
2 changes: 1 addition & 1 deletion dom/test/DomTestingLibrary_test.re
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ afterEach(() =>
}
);

afterAll(Bisect_melange.Runtime.write_coverage_data);
afterAll(Bisect.Runtime.write_coverage_data);

describe("DomTestingLibrary", () => {
open DomTestingLibrary;
Expand Down
4 changes: 3 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@

(package
(name melange-testing-library)
(synopsis "Melange bindings for testing-library (dom-testing-library and react-testing-library)")
(synopsis
"Melange bindings for testing-library (dom-testing-library and react-testing-library)")
(depends
ocaml
(melange
(>= "2.0.0"))
reason-react
(melange-webapi :with-test)
(melange-jest :with-test)
(opam-check-npm-deps :with-test) ; todo: use with-dev-setup once opam 2.2 is out
(bisect_ppx
Expand Down
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module.exports = {
rootDir: "./_build/default/",
testMatch: ["**/*_test.js"],
/* Ignoring these, as they are just temporary copies from runtime_deps, the final ones are in the
path created using the melange.emit target, e.g. _build/default/dom/test/test/dom/test/__snapshots__ */
modulePathIgnorePatterns: ["react/test/__snapshots__", "dom/test/__snapshots__"]
};

3 changes: 2 additions & 1 deletion melange-testing-library.opam
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ depends: [
"ocaml"
"melange" {>= "2.0.0"}
"reason-react"
"melange-webapi" {with-test}
"melange-jest" {with-test}
"opam-check-npm-deps" {with-test}
"bisect_ppx" {with-test & >= "2.5.0"}
Expand All @@ -38,5 +39,5 @@ depexts: [
["@testing-library/dom"] {npm-version = "^7.26.3"}
]
pin-depends: [
[ "bisect_ppx.dev" "git+https://github.com/jchavarri/bisect_ppx.git#a0c2375ca20beceb55e53776e03812def3bc32ba" ]
[ "bisect_ppx.dev" "git+https://github.com/jchavarri/bisect_ppx.git#d169ba4a5a36a656dbae4734bb6375f2d48d68f1" ]
]
2 changes: 1 addition & 1 deletion melange-testing-library.opam.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ depexts: [
["@testing-library/dom"] {npm-version = "^7.26.3"}
]
pin-depends: [
[ "bisect_ppx.dev" "git+https://github.com/jchavarri/bisect_ppx.git#a0c2375ca20beceb55e53776e03812def3bc32ba" ]
[ "bisect_ppx.dev" "git+https://github.com/jchavarri/bisect_ppx.git#d169ba4a5a36a656dbae4734bb6375f2d48d68f1" ]
]
2 changes: 1 addition & 1 deletion react/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
(wrapped false)
(modes melange)
(preprocess
(pps melange.ppx)))
(pps bisect_ppx melange.ppx)))
2 changes: 1 addition & 1 deletion react/test/ReactTestingLibrary_test.re
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

open Jest;

afterAll(Bisect_melange.Runtime.write_coverage_data);
afterAll(Bisect.Runtime.write_coverage_data);

module Greeting = {
[@react.component]
Expand Down