defenseunicorns / defenseunicorns/pepr-docs
Remove Unnecessary `VITEST_RUN_E2E` Environment Variable
- Dominant language
- JavaScript
- Stars
- 6
- Forks
- 1
- Avg merge
- 23h 7m
- Merged PRs (30d)
- 14
Description
## Description
The `VITEST_RUN_E2E` environment variable is used to control whether e2e tests are excluded from the test run, but this mechanism appears redundant given actual usage.
Current Implementation:
`vitest.config.js:6-8` - Conditionally excludes `e2e-*.test.?(m)js` files based on `VITEST_RUN_E2E`
`.github/workflows/scripts/linkcheck.sh:45` - Sets `VITEST_RUN_E2E=true` when running the e2e test
Why it's unnecessary:
* The e2e test is always run explicitly by filename - `linkcheck.sh` directly invokes vitest run `scripts/tests/e2e-link-validation.test.mjs`, which means Vitest is told exactly which file to run.
* There's only ONE e2e test file - `e2e-link-validation.test.mjs` is the only file matching the `e2e-*.test.?(m)js` pattern
* The test workflow already separates concerns - `.github/workflows/test.yml:57-62` runs unit tests separately from link validation (lines 64-68).
* The npm scripts already handle separation - `package.json:21` runs `vitest run scripts/tests/` (unit tests) then `npm run linkcheck` (e2e)
## Related Files
https://github.com/defenseunicorns/pepr-docs/blob/main/vitest.config.js
https://github.com/defenseunicorns/pepr-docs/blob/main/.github/workflows/scripts/linkcheck.sh
## Definition of Done
Verify the above observations and remove the `VITEST_RUN_E2E` envar if we can confirm it's unnecessary. During review of #160 we noticed that
the environment variable might be solving a problem that doesn't exist.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.