Repository navigation
web: Allow the vite oxc transform to compile co-located unit tests. - #23991
Conversation
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #23991 +/- ##
=======================================
Coverage 91.37% 91.37%
=======================================
Files 1137 1137
Lines 71591 71591
Branches 3875 3875
=======================================
Hits 65416 65416
Misses 6140 6140
Partials 35 35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-7da09b4ddb52a643e1f32c67b2d1335094a0d90c
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-7da09b4ddb52a643e1f32c67b2d1335094a0d90cAfterwards, run the upgrade commands from the latest release notes. |
1e0b16d to
8002f21
Compare
Vite 8's vite:oxc plugin does per-file tsconfig discovery and refuses to transform src/**/*.unit.test.ts because the root tsconfig.json excludes src/**/*.test.ts. Disable tsconfig discovery for the Node "Unit Tests" project so oxc transforms those files, leaving tsconfig.json's excludes and tsgo -p . untouched.
8002f21 to
7da09b4
Compare
Details
What does this PR change?
One config change in the "Unit Tests" vitest project:
oxc: { tsconfig: false }, disabling the per-file tsconfig discovery that Vite 8's built-in oxc transform performs when compiling TypeScript test files.Today that discovery makes every co-located unit test under
web/src/fail before running: the roottsconfig.jsonexcludessrc/**/*.test.ts, and the transform refuses excluded files with[TSCONFIG_ERROR] Tsconfig not found. The committedsrc/polyfill/custom-elements-get-name.unit.test.tsfails this way today (masked in CI, see #23989). Tests undertest/unit/are unaffected; they have their own tsconfig.This only touches how vitest compiles test files.
lint:types, the build, ESLint, and Prettier are unchanged — this is the transform half of the oxc toolchain that ships inside Vite 8, not the Oxlint/Oxfmt adoption tracked in #23519, which stays deferred.Why is this change needed?
Upcoming router PRs (#23990, #23988) ship co-located unit tests under
web/src/, and the existing polyfill test should run at all. Scoping the workaround to the vitest project keeps the root tsconfig excludes intact for typechecking; when the broader oxc story lands via #23519, this line is the marker for revisiting.How was this tested?
pnpm exec vitest run --project "Unit Tests"fromweb/: the polyfill test file compiles and passes (previously failed at transform);test/unit/unaffected (41 tests total).pnpm run lint:typesoutput identical before and after.Linked issues
refs #23519
Checklist
make all)make docs)