Fix: Bug in #1299 - Test had a syntx error (#1301)
Commit: 43795b1f7e829c2394b7fa6219cb8d32495a89d5
Date: 2026-05-14 12:26:04 +0000
Author: PascalHavelange
Commit Message
Fix: Bug in #1299 - Test had a syntx error (#1301)
Here's a summary of what was found and fixed:
---
## Root cause
**Broken file**: monument-picture-importer.test.ts (line 245)
PR #1300 added a regression test for the `getParentItemName()` fix using this destructuring syntax in a `.find()` callback:
```typescript
// Before (broken) — TypeScript error:
([sql]: [string]) => typeof sql === 'string' && ...
TypeScript rejects this because mock.calls is typed as any[][], and any[] cannot be narrowed to the tuple [string] (requires exactly 1 element). The fix:
// After (fixed):
(args) => typeof args[0] === 'string' && args[0].includes('FROM mwnf3.monuments') && !args[0].includes('pictures')
The importer now builds cleanly and all 338 tests pass.
Why CI didn’t catch it
Two gaps in the workflow structure:
-
Mandatory Checks (continuous-integration.yml): The
audit-npm-importerjob only runsnpm audit --audit-level moderate— nonpm run buildand nonpm test. TypeScript errors in importer code are invisible to this job. -
Build and Test (ci-build-test.yml, non-required check): The
detect-changesjob had no path group forscripts/importer/**, so no validation job was ever triggered for importer changes — even as a non-blocking check.
CI fix applied
Added to ci-build-test.yml:
importer=trueoutput indetect-changeswhenscripts/importer/**files change- New
importer-validationjob that runsnpm run build+npm testwhenimporter=true
Updated README.md to document the new path group and job.
Note: ci-build-test.yml is a non-required check. If you want importer build failures to block PR merges, the
audit-npm-importerjob in continuous-integration.yml would also neednpm run buildandnpm testadded, or theci-successrequired check extended to cover it.
Co-authored-by: Pascal HAVELANGE havelangep@hotmail.com ```
Files Changed
- 📝 Modified:
.github/workflows/README.md - 📝 Modified:
.github/workflows/ci-build-test.yml - 📝 Modified:
scripts/importer/tests/unit/monument-picture-importer.test.ts
Links
This documentation was automatically generated from Git commit data.