Skip to content

Fix: update API test script to target files and add regression check (Fixes #4111)#4112

Open
mvmax-dev wants to merge 1 commit into
SecureBananaLabs:mainfrom
mvmax-dev:sovereign/fix-4111
Open

Fix: update API test script to target files and add regression check (Fixes #4111)#4112
mvmax-dev wants to merge 1 commit into
SecureBananaLabs:mainfrom
mvmax-dev:sovereign/fix-4111

Conversation

@mvmax-dev

Copy link
Copy Markdown

This PR fixes issue #4111.

Problem

The API package test script in apps/api/package.json was configured to run node --test src/tests. Because it targeted the directory instead of files, the Node.js test runner failed with MODULE_NOT_FOUND error when trying to resolve apps/api/src/tests.

Solution

  1. Updated the test script inside apps/api/package.json to target concrete test files: node --test src/tests/*.test.js.
  2. Implemented a new regression check file apps/api/src/tests/package.test.js that reads package.json and asserts that the test script targets the files correctly and doesn't fall back to targeting the directory.

All tests passed successfully:

> test
> node --test src/tests/*.test.js

TAP version 13
# Subtest: GET /health returns ok payload
ok 1 - GET /health returns ok payload
  ---
  duration_ms: 41.828506
  type: 'test'
  ...
# Subtest: package.json test script regression check
ok 2 - package.json test script regression check
  ---
  duration_ms: 0.669546
  type: 'test'
  ...
1..2
# tests 2
# suites 0
# pass 2
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 244.246914

Closes #4111

github-actions Bot added a commit that referenced this pull request Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API test script should target test files instead of the test directory

1 participant