From a645d167d6cc46378b74f2e63dda29f94dd7c2b5 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 25 Sep 2025 12:27:43 +0100 Subject: [PATCH 1/4] Add `npm run ava` command (for `ava` without a specific path) --- lib/analyze-action-post.js | 3 ++- lib/analyze-action.js | 3 ++- lib/autobuild-action.js | 3 ++- lib/init-action-post.js | 3 ++- lib/init-action.js | 3 ++- lib/resolve-environment-action.js | 3 ++- lib/start-proxy-action-post.js | 3 ++- lib/start-proxy-action.js | 3 ++- lib/upload-lib.js | 3 ++- lib/upload-sarif-action-post.js | 3 ++- lib/upload-sarif-action.js | 3 ++- package.json | 3 ++- 12 files changed, 24 insertions(+), 12 deletions(-) diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index 4c38451e83..10b5ba3f7c 100644 --- a/lib/analyze-action-post.js +++ b/lib/analyze-action-post.js @@ -26447,7 +26447,8 @@ var require_package = __commonJS({ lint: "eslint --report-unused-disable-directives --max-warnings=0 .", "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - test: "npm run transpile && ava src/ --serial --verbose", + ava: "npm run transpile && ava --serial --verbose", + test: "npm run ava -- src/", "test-debug": "npm run test -- --timeout=20m", transpile: "tsc --build --verbose" }, diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 4b25ff4434..54e1c30da6 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -32296,7 +32296,8 @@ var require_package = __commonJS({ lint: "eslint --report-unused-disable-directives --max-warnings=0 .", "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - test: "npm run transpile && ava src/ --serial --verbose", + ava: "npm run transpile && ava --serial --verbose", + test: "npm run ava -- src/", "test-debug": "npm run test -- --timeout=20m", transpile: "tsc --build --verbose" }, diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 0ec50725c2..ca3d71e98e 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -26447,7 +26447,8 @@ var require_package = __commonJS({ lint: "eslint --report-unused-disable-directives --max-warnings=0 .", "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - test: "npm run transpile && ava src/ --serial --verbose", + ava: "npm run transpile && ava --serial --verbose", + test: "npm run ava -- src/", "test-debug": "npm run test -- --timeout=20m", transpile: "tsc --build --verbose" }, diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 27a7a1682d..26412f352c 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -32296,7 +32296,8 @@ var require_package = __commonJS({ lint: "eslint --report-unused-disable-directives --max-warnings=0 .", "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - test: "npm run transpile && ava src/ --serial --verbose", + ava: "npm run transpile && ava --serial --verbose", + test: "npm run ava -- src/", "test-debug": "npm run test -- --timeout=20m", transpile: "tsc --build --verbose" }, diff --git a/lib/init-action.js b/lib/init-action.js index 5bd9f385a9..08298bc816 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -32296,7 +32296,8 @@ var require_package = __commonJS({ lint: "eslint --report-unused-disable-directives --max-warnings=0 .", "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - test: "npm run transpile && ava src/ --serial --verbose", + ava: "npm run transpile && ava --serial --verbose", + test: "npm run ava -- src/", "test-debug": "npm run test -- --timeout=20m", transpile: "tsc --build --verbose" }, diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index 41d3e68bb1..0eaf2183eb 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -26447,7 +26447,8 @@ var require_package = __commonJS({ lint: "eslint --report-unused-disable-directives --max-warnings=0 .", "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - test: "npm run transpile && ava src/ --serial --verbose", + ava: "npm run transpile && ava --serial --verbose", + test: "npm run ava -- src/", "test-debug": "npm run test -- --timeout=20m", transpile: "tsc --build --verbose" }, diff --git a/lib/start-proxy-action-post.js b/lib/start-proxy-action-post.js index 484ceb79e6..25d1e2d1aa 100644 --- a/lib/start-proxy-action-post.js +++ b/lib/start-proxy-action-post.js @@ -26447,7 +26447,8 @@ var require_package = __commonJS({ lint: "eslint --report-unused-disable-directives --max-warnings=0 .", "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - test: "npm run transpile && ava src/ --serial --verbose", + ava: "npm run transpile && ava --serial --verbose", + test: "npm run ava -- src/", "test-debug": "npm run test -- --timeout=20m", transpile: "tsc --build --verbose" }, diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index 21508de07e..8a94566569 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -44975,7 +44975,8 @@ var require_package = __commonJS({ lint: "eslint --report-unused-disable-directives --max-warnings=0 .", "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - test: "npm run transpile && ava src/ --serial --verbose", + ava: "npm run transpile && ava --serial --verbose", + test: "npm run ava -- src/", "test-debug": "npm run test -- --timeout=20m", transpile: "tsc --build --verbose" }, diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 934d9c7e58..8dfb2a1e22 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -33593,7 +33593,8 @@ var require_package = __commonJS({ lint: "eslint --report-unused-disable-directives --max-warnings=0 .", "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - test: "npm run transpile && ava src/ --serial --verbose", + ava: "npm run transpile && ava --serial --verbose", + test: "npm run ava -- src/", "test-debug": "npm run test -- --timeout=20m", transpile: "tsc --build --verbose" }, diff --git a/lib/upload-sarif-action-post.js b/lib/upload-sarif-action-post.js index 0e1dd29920..216b905035 100644 --- a/lib/upload-sarif-action-post.js +++ b/lib/upload-sarif-action-post.js @@ -26447,7 +26447,8 @@ var require_package = __commonJS({ lint: "eslint --report-unused-disable-directives --max-warnings=0 .", "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - test: "npm run transpile && ava src/ --serial --verbose", + ava: "npm run transpile && ava --serial --verbose", + test: "npm run ava -- src/", "test-debug": "npm run test -- --timeout=20m", transpile: "tsc --build --verbose" }, diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 5cc12ec1bf..828d74c212 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -32296,7 +32296,8 @@ var require_package = __commonJS({ lint: "eslint --report-unused-disable-directives --max-warnings=0 .", "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - test: "npm run transpile && ava src/ --serial --verbose", + ava: "npm run transpile && ava --serial --verbose", + test: "npm run ava -- src/", "test-debug": "npm run test -- --timeout=20m", transpile: "tsc --build --verbose" }, diff --git a/package.json b/package.json index 8920aacd17..178ee04344 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "lint": "eslint --report-unused-disable-directives --max-warnings=0 .", "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - "test": "npm run transpile && ava src/ --serial --verbose", + "ava": "npm run transpile && ava --serial --verbose", + "test": "npm run ava -- src/", "test-debug": "npm run test -- --timeout=20m", "transpile": "tsc --build --verbose" }, From e2e1db3e4e0d1c9bd8d7fdac3ea940623f37c41f Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 25 Sep 2025 12:28:27 +0100 Subject: [PATCH 2/4] Update `CONTRIBUTING.md` with `npm run ava` --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 83fff23936..493ae847cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,6 +20,7 @@ Before you start, ensure that you have a recent version of node (16 or higher) i * Transpile the TypeScript to JavaScript: `npm run build`. Note that the JavaScript files are committed to git. * Run tests: `npm run test`. You’ll need to ensure that the JavaScript files are up-to-date first by running the command above. * Run the linter: `npm run lint`. +* Run tests for a specific path: `npm run ava -- ./src/filename.test.ts` or `npm run ava -- ./src/feature-flags/` This project also includes configuration to run tests from VSCode (with support for breakpoints) - open the test file you wish to run and choose "Debug AVA test file" from the Run menu in the Run panel. From 77a92597617510db41350515489014b0b8067d26 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 25 Sep 2025 12:32:31 +0100 Subject: [PATCH 3/4] Exclude transpiled code and dependencies from VSCode search --- .vscode/settings.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index 629fb7b542..f417dd2a6e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,6 +8,11 @@ "build": true, "lib": true, }, + "search.exclude": { + "**/node_modules": true, + "build": true, + "lib": true, + }, // Installing a new Node package often triggers VS Code's git limit warnings as there is typically // an intermediate stage where many files are modified. This setting suppresses these warnings. "git.ignoreLimitWarning": true, From 48be21c31e49b7f7e9eff3faeb80181955f64cbb Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 25 Sep 2025 12:37:18 +0100 Subject: [PATCH 4/4] Use `npm run ava` in `justfile` --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index c951b4b063..ed9d9eb1db 100644 --- a/justfile +++ b/justfile @@ -22,7 +22,7 @@ test: build # Run the tests for a single file test_file filename: build - npx ava --serial --verbose {{filename}} + npm run ava {{filename}} [doc("Refresh the .js build artefacts in the lib directory")] [confirm]