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:

  1. Mandatory Checks (continuous-integration.yml): The audit-npm-importer job only runs npm audit --audit-level moderateno npm run build and no npm test. TypeScript errors in importer code are invisible to this job.

  2. Build and Test (ci-build-test.yml, non-required check): The detect-changes job had no path group for scripts/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:

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-importer job in continuous-integration.yml would also need npm run build and npm test added, or the ci-success required check extended to cover it.

Co-authored-by: Pascal HAVELANGE havelangep@hotmail.com ```

Files Changed


This documentation was automatically generated from Git commit data.