Skip to content

Commit 82ece6d

Browse files
committed
Tests: Per-scenario Vite cache dir in createTestApp
`path.basename(appRoot)` returns `"app"` for every scenario (each scenario has `<scenario>/app/`), so all scenarios shared one Vite cache dir and forced re-optimization on every fixture run as the cache flipped between configs. Use the parent directory name instead — `crud`, `scopes`, etc. — so each scenario keeps its own cache.
1 parent a15b3aa commit 82ece6d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/utils/app.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ export function createTestApp(
109109
cacheDir: path.join(
110110
os.tmpdir(),
111111
'dito-e2e-vite-cache',
112-
path.basename(options.admin!.root!)
112+
// Use the parent directory name so each scenario gets its own
113+
// cache. `path.basename(appRoot)` is `"app"` for every scenario
114+
// (each one has `<scenario>/app/`), which collides and forces
115+
// Vite to re-optimize deps on every fixture run.
116+
path.basename(path.dirname(options.admin!.root!))
113117
)
114118
})
115119
app.loadAdminViteConfig =

0 commit comments

Comments
 (0)