Skip to content

Update API tests for current endpoint behavior and ESM-compatible Chai loading - #84

Merged
aaronparker merged 2 commits into
updatesfrom
copilot/fix-github-actions-api-tests
Sep 24, 2026
Merged

aaronparker merged 2 commits into
updatesfrom
copilot/fix-github-actions-api-tests

Conversation

Copilot AI commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

The failing API test job was exercising outdated assumptions about the live API while also depending on CommonJS-style chai loading. This change aligns the test harness with the current production contract and Node environments used in Actions.

  • Test harness compatibility

    • Load chai with dynamic import() in a before hook so the suite works when chai is resolved as ESM.
    • Keep assert initialization explicit and local to test startup.
  • Configurable API target

    • Add API_BASE_URL support so the suite can be pointed at an alternate endpoint without editing the test file.
    • Preserve the current production URL as the default.
  • Behavior-aligned test coverage

    • Retain the broader endpoint assertions already present in this branch so tests accept the current live API behavior instead of enforcing superseded 404 / request-validation responses.
const baseUrl = process.env.API_BASE_URL || 'https://evergreen-api.stealthpuppy.com';
const request = require('supertest')(baseUrl);
let assert;

before(async () => {
    const chai = await import('chai');
    assert = chai.assert;
});

@aaronparker
aaronparker changed the base branch from main to updates September 24, 2026 02:51
@aaronparker
aaronparker marked this pull request as ready for review September 24, 2026 02:52
Co-authored-by: aaronparker <8227455+aaronparker@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job Run API Tests (18.x) Update API tests for current endpoint behavior and ESM-compatible Chai loading Sep 24, 2026
Copilot AI requested a review from aaronparker September 24, 2026 02:52
@aaronparker
aaronparker merged commit 5d0ba83 into updates Sep 24, 2026
7 of 10 checks passed
@aaronparker
aaronparker deleted the copilot/fix-github-actions-api-tests branch September 24, 2026 05:12
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.

2 participants