Skip to content

Commit

Permalink
jest: ignore these directories when discover tests
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
JGreenlee committed Sep 20, 2023
1 parent f24ce9d commit 1d0ddca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/serve-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"testPathIgnorePatterns": [
"/node_modules/",
"/platforms/",
"/plugins/",
"/lib/",
"/manual_lib/"
],
"transform": {
"^.+\\.(ts|tsx|js|jsx)$": "ts-jest"
},
Expand Down
2 changes: 1 addition & 1 deletion package.serve.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1d0ddca

Please sign in to comment.