diff --git a/Makefile b/Makefile index db63a6a..bdff9ce 100644 --- a/Makefile +++ b/Makefile @@ -49,9 +49,13 @@ format-check: ## Checks if format is correct 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 || true # Jest will fail because dune & melange produce duplicated snapshots files with runtime_deps so it marks them as obsolete + $(DUNE) runtest opam exec -- bisect-ppx-report html diff --git a/jest.config.js b/jest.config.js index 8d9e815..3070c75 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,8 @@ module.exports = { rootDir: "./_build/default/", testMatch: ["**/*_test.js"], + // ignoring these, are they are just temporary copies from runtime_deps, the final ones are in + // the path with melange.emit target, e.g. _build/default/dom/test/test/dom/test/__snapshots__ + modulePathIgnorePatterns: ["react/test/__snapshots__", "dom/test/__snapshots__"] }; \ No newline at end of file