Fix broken test suite and untrack runtime artifacts

- Bridge jsdom localStorage/sessionStorage over Node 22+'s experimental
  globals that vitest's jsdom environment doesn't override
- Update Greek lookup tests to mock the OpenScriptures Strong's
  dictionary instead of the retired bolls.life path
- Update migrateChunk no-op test for backfilled fields
- Match en-dash verse range labels in chunk creation test
- Untrack .api.log/.api.pid and gitignore them

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
nmemmert
2026-06-11 16:40:44 -04:00
parent c0ceb68faa
commit d1861ec5d9
7 changed files with 51 additions and 21 deletions
+17
View File
@@ -1 +1,18 @@
import '@testing-library/jest-dom';
// Node 22+ defines experimental localStorage/sessionStorage globals that are
// undefined unless --localstorage-file is passed. Vitest's jsdom environment
// skips copying window keys that already exist on the Node global, so jsdom's
// storage objects get shadowed. Bridge them from the raw jsdom instance.
const jsdomWindow = globalThis.jsdom?.window;
if (jsdomWindow) {
for (const key of ['localStorage', 'sessionStorage']) {
if (typeof globalThis[key] === 'undefined' && jsdomWindow[key]) {
Object.defineProperty(globalThis, key, {
value: jsdomWindow[key],
writable: true,
configurable: true,
});
}
}
}