From 05fb1f61d56c29f5637dc7fba218e92a24145f92 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 14 May 2021 08:28:51 +0200 Subject: [PATCH] Add jest rootDir and test-frontend dependency (#15860) - Define jest rootDir to limit where it looks for test files - Add missing dependency on test-frontend target so it can be ran from a clean checkout --- Makefile | 2 +- jest.config.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6074f541c7e9..8a27365aa96c 100644 --- a/Makefile +++ b/Makefile @@ -359,7 +359,7 @@ test-backend: @$(GO) test $(GOTESTFLAGS) -mod=vendor -tags='$(TEST_TAGS)' $(GO_PACKAGES) .PHONY: test-frontend -test-frontend: +test-frontend: node_modules @NODE_OPTIONS="--experimental-vm-modules --no-warnings" npx jest --color .PHONY: test-check diff --git a/jest.config.js b/jest.config.js index 317b64d7c134..f95ef1c39cab 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,8 +1,9 @@ export default { setupFilesAfterEnv: ['jest-extended'], testTimeout: 20000, + rootDir: 'web_src', testMatch: [ - '**/web_src/**/*.test.js', + '/**/*.test.js', ], transform: {}, verbose: false,