Skip to content

test(storage-resize-images): fix the config-load error test - #3308

Merged
IzaakGough merged 1 commit into
kitsfrom
fix/kits-resize-images-config-error-test
Oct 27, 2026
Merged

IzaakGough merged 1 commit into
kitsfrom
fix/kits-resize-images-config-error-test

Conversation

@IzaakGough

@IzaakGough IzaakGough commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Tests for the resize images kit fail on kits, which blocks every PR that touches the kit, including #3307.

#3280 and #3281 merged together: #3280 rejects a bad SHARP_OPTIONS at deploy, but a test from #3281 still uses one to cause a config error when an event runs.

This uses an invalid CONTENT_FILTER_LEVEL instead, which still fails during config loading in the handler, and checks the exact error message.

Tested by running the kit test suite locally (276 passed). Not tested in CI yet.

…NT_FILTER_LEVEL

An invalid SHARP_OPTIONS is now rejected when the module loads, so it no
longer reaches the handler's error logging.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the expectLoggedAtError helper function in unhandled-error.test.ts to return the caught error, and updates a test case to assert on the specific error message when an invalid CONTENT_FILTER_LEVEL is provided. The feedback suggests refactoring expectLoggedAtError to be generic, which would improve type safety and preserve the specific error type being thrown.

Comment thread kits/storage-resize-images/tests/unhandled-error.test.ts
Comment thread kits/storage-resize-images/tests/unhandled-error.test.ts
@IzaakGough
IzaakGough marked this pull request as ready for review October 27, 2026 16:54
@IzaakGough
IzaakGough merged commit 48660c3 into kits Oct 27, 2026
11 checks passed
@IzaakGough
IzaakGough deleted the fix/kits-resize-images-config-error-test branch October 27, 2026 16:56
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