From 1d0ddca5ed41bb8336cec4a75fa378bca1070082 Mon Sep 17 00:00:00 2001 From: Jack Greenlee Date: Wed, 20 Sep 2023 16:39:45 -0400 Subject: [PATCH] jest: ignore these directories when discover tests We should only look for tests in our `www/__tests__` directory, not any other `__tests__` directories that may exist in dependencies or anywhere in the project directory tree. Further, by explicitly ignoring these directories, we don't have to specify `npx jest www/__tests__`, and can simply run `npx jest`. --- .github/workflows/serve-install.yml | 2 +- jest.config.json | 7 +++++++ package.serve.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/serve-install.yml b/.github/workflows/serve-install.yml index 04b3c8b2f..a5e634821 100644 --- a/.github/workflows/serve-install.yml +++ b/.github/workflows/serve-install.yml @@ -59,7 +59,7 @@ jobs: - name: Run Jest tests shell: bash -l {0} run: | - npx jest www/__tests__ + npx jest # TODO: figure out how to check that a server started correctly # - name: Try starting it diff --git a/jest.config.json b/jest.config.json index d9655cbf8..78dc839b4 100644 --- a/jest.config.json +++ b/jest.config.json @@ -1,4 +1,11 @@ { + "testPathIgnorePatterns": [ + "/node_modules/", + "/platforms/", + "/plugins/", + "/lib/", + "/manual_lib/" + ], "transform": { "^.+\\.(ts|tsx|js|jsx)$": "ts-jest" }, diff --git a/package.serve.json b/package.serve.json index 7eb50a4a1..a342a73de 100644 --- a/package.serve.json +++ b/package.serve.json @@ -11,7 +11,7 @@ "setup-serve": "./bin/download_settings_controls.js && ./bin/setup_autodeploy.js", "serve": "webpack --config webpack.dev.js && concurrently -k \"phonegap --verbose serve\" \"webpack --config webpack.dev.js --watch\"", "serve-only": "phonegap --verbose serve", - "test": "npx jest www/__tests__" + "test": "npx jest" }, "devDependencies": { "@babel/core": "^7.21.3",