From 82d6021cab4b7ba25a1fef268f7ba75b12d513d4 Mon Sep 17 00:00:00 2001 From: Javier Chavarri Date: Thu, 26 Oct 2023 07:03:04 +0000 Subject: [PATCH] fix tests --- Makefile | 6 +++++- jest.config.js | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) 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