Skip to content

Add tests for getImageProperties function#17

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-tests-get-image-properties
Draft

Add tests for getImageProperties function#17
Copilot wants to merge 4 commits intomainfrom
copilot/add-tests-get-image-properties

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

Added test coverage for the getImageProperties function, which reads image metadata using Sharp.

Changes

  • src/lib.test.ts: 4 test cases covering valid inputs, error handling, aspect ratio validation, and type safety
  • deno.json: Added test task with required permissions (--allow-read --allow-env --allow-ffi) and @std/assert import

Test Coverage

// Valid image properties
const properties = await getImageProperties("test.png");
// Returns: { width: 512, height: 512, format: "png" }

// Non-existent file handling
await getImageProperties("missing.png");
// Throws: Deno.errors.NotFound

// Aspect ratio verification
const props = await getImageProperties("3x2-checker.png");
const ratio = props.width / props.height; // 1.5

All imports use deno.land/std URLs rather than JSR specifiers for compatibility.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.deno.land
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
  • jsr.io
    • Triggering command: /usr/local/bin/deno /usr/local/bin/deno test --allow-read (dns block)
    • Triggering command: /usr/local/bin/deno deno test --allow-read --unsafely-ignore-certificate-errors (dns block)
    • Triggering command: /usr/bin/curl curl -I REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add tests for getImageProperties function</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits March 2, 2026 18:15
Co-authored-by: marlonmarcello <1956448+marlonmarcello@users.noreply.github.com>
Co-authored-by: marlonmarcello <1956448+marlonmarcello@users.noreply.github.com>
Co-authored-by: marlonmarcello <1956448+marlonmarcello@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tests for getImageProperties function Add tests for getImageProperties function Mar 2, 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.

Add tests for getImageProperties function

2 participants