diff options
| author | ojacobson <ojacobson@noreply.codeberg.org> | 2025-05-30 21:13:28 +0200 |
|---|---|---|
| committer | ojacobson <ojacobson@noreply.codeberg.org> | 2025-05-30 21:13:28 +0200 |
| commit | 414de683b23d0c14a56934bc04f930301b369035 (patch) | |
| tree | 00c860d1f0fea005583c67330ae63dd6594f92da | |
| parent | 7a5c82d9b86e0a0828f4ccaac42b2db398945406 (diff) | |
| parent | 515cd2dbe6f202c92b938c4f7364c97b4eac9ab1 (diff) | |
Consolidate testing steps into `tools/test`.
I've opted to run with `--coverage` to ensure that we continue exercising coverage support. Hat tip to @wlonk for holding me accountable on this - I had thought coverage was broken, but I was holding it wrong.
Also adjusts the code coverage failure thresholds to match here-and-now reality. I'm not offering a policy thought here, just making sure we
1. use the coverage checking we have, and
2. set standards we are actually achieving.
This was originally part of [another proposal][pr-6]. I've broken it out to make the intent clearer, and to make the proposal easier to get a handle on in isolation from other, related changes. Thanks to @wlonk for their input on this!
[pr-6]: https://codeberg.org/ojacobson/pilcrow/pulls/6
Merges prop/test-tool into main.
| -rw-r--r-- | package.json | 4 | ||||
| -rwxr-xr-x | tools/test | 13 | ||||
| -rwxr-xr-x | tools/test-all | 10 | ||||
| -rwxr-xr-x | tools/test-server | 9 | ||||
| -rwxr-xr-x | tools/test-ui | 9 | ||||
| -rw-r--r-- | vite.config.js | 8 |
6 files changed, 18 insertions, 35 deletions
diff --git a/package.json b/package.json index 85099e8..4501576 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,7 @@ }, "scripts": { "lint": "prettier --check ui && eslint ui", - "format": "prettier --write ui", - "test": "vitest", - "coverage": "vitest run --coverage" + "format": "prettier --write ui" }, "devDependencies": { "@sveltejs/adapter-static": "^3.0.8", diff --git a/tools/test b/tools/test new file mode 100755 index 0000000..06e2159 --- /dev/null +++ b/tools/test @@ -0,0 +1,13 @@ +#!/bin/bash -e + +## tools/test +## +## Run the full test suite. +## +## Best run as `tools/test` even if you have the `tools` directory in your +## $PATH, due to naming collisions with the `test` shell builtin or `/bin/test`. + +cd "$(dirname "$0")/.." + +npx vitest --run --coverage +cargo test diff --git a/tools/test-all b/tools/test-all deleted file mode 100755 index 0ad3ca3..0000000 --- a/tools/test-all +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -e - -## tools/test-all -## -## Run the full test suite. - -cd "$(dirname "$0")/.." - -tools/test-ui -tools/test-server diff --git a/tools/test-server b/tools/test-server deleted file mode 100755 index 44bdf76..0000000 --- a/tools/test-server +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -e - -## tools/test-server -## -## Run the server test suite. - -cd "$(dirname "$0")/.." - -cargo test diff --git a/tools/test-ui b/tools/test-ui deleted file mode 100755 index eff5a07..0000000 --- a/tools/test-ui +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -e - -## tools/test-ui -## -## Run the UI test suite. - -cd "$(dirname "$0")/.." - -npm run test -- --run diff --git a/vite.config.js b/vite.config.js index 4bd448f..fcf28aa 100644 --- a/vite.config.js +++ b/vite.config.js @@ -13,10 +13,10 @@ export default defineConfig({ restoreMocks: true, coverage: { thresholds: { - statements: 49, - branches: 60, - functions: 14, - lines: 49 + statements: 12, + branches: 85, + functions: 75, + lines: 12 }, exclude: [ ...configDefaults.exclude, |
