Skip to content

Add test coverage for generate function#28

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-tests-for-generate-function
Draft

Add test coverage for generate function#28
Copilot wants to merge 4 commits intomainfrom
copilot/add-tests-for-generate-function

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

The generate function lacked test coverage for validation logic, error handling, and tile generation workflows.

Changes

  • main_test.ts: 9 tests covering successful generation (default/degrees/custom output), input validation (missing/non-existent files), angle bounds checking, and dimension validation
  • main.ts: Exported generate function for testing
  • deno.json: Added test task
  • README.md: Added testing section with deno task test usage

Test Scenarios

// Successful generation
await generate({ input: "image.png", angleOption: 0 });
await generate({ input: "image.png", degrees: 45 });

// Error handling
await generate({ input: "/nonexistent.png" }); // throws
await generate({ angleOption: 999 }); // throws
await generate({ angleOption: 7, maxValidSize: 100 }); // dimension validation

Tests use temporary files in /tmp with cleanup in finally blocks.

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)
    • Triggering command: /usr/bin/curl curl --fail --location --progress-bar --output /home/REDACTED/.deno/bin/deno.zip 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 generate main 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:21
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 generate main function Add test coverage for generate 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 generate main function

2 participants