Skip to content

Conversation

@bosschaert
Copy link
Contributor

Related Issues

Contributes to #43

@github-actions
Copy link

This PR will trigger a minor release when merged.

@bosschaert bosschaert marked this pull request as ready for review December 19, 2025 16:48
Comment on lines 139 to 141
try {
await getValidHtml(setupContext(), Buffer.from(htmlIn), [], {});
assert.fail('Expected an error to be thrown');
Copy link
Contributor

Choose a reason for hiding this comment

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

use assert.rejects()

assert.fail('Expected an error to be thrown');
} catch (e) {
assert.equal(e.statusCode, 400);
assert.equal(e.errorCode, 'AEM_BACKEND_MP4_PARSING_FAILED');
Copy link
Contributor

Choose a reason for hiding this comment

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

use assert.rejects()

Copy link
Contributor

@tripodsan tripodsan left a comment

Choose a reason for hiding this comment

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

LGTM, tests can be improved.

@bosschaert
Copy link
Contributor Author

I have rewritten the tests that expect an Error to use assert.rejects() as suggested.

One thought I have about this is that if you have the assert.rejects() like this:

await assert.rejects(getValidHtml(setupContext(), Buffer.from(htmlIn), [], mockMH),
      new StatusCodeError('Error getting blob for image: https://example.com/image.jpg', 400));

if you accidentally forget the await the test becomes moot and always passes. Maybe this is not so much of an issue but it's just one thing to keep an eye on...

@bosschaert bosschaert requested a review from tripodsan December 22, 2025 10:52
@tripodsan tripodsan merged commit 7b45695 into main Jan 8, 2026
6 checks passed
@tripodsan tripodsan deleted the post-img branch January 8, 2026 13:53
github-actions bot pushed a commit that referenced this pull request Jan 8, 2026
# [1.26.0](v1.25.1...v1.26.0) (2026-01-08)

### Features

* **source:** intern images on POST check internal on PUT ([#74](#74)) ([7b45695](7b45695))
@github-actions
Copy link

github-actions bot commented Jan 8, 2026

🎉 This PR is included in version 1.26.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants