Skip to content

Conversation

@ThyMinimalDev
Copy link
Contributor

What does this PR do?

Adds comprehensive unit tests for the Tasker class in packages/lib/tasker/Tasker.ts, focusing on:

  • Verifying that parameters are properly passed to tasker methods
  • Testing the fallback behavior when the async tasker fails (sync tasker should be invoked with the same params)
  • Error handling when both async and sync taskers fail

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - test-only changes
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Run the tests with:

TZ=UTC yarn test packages/lib/tasker/Tasker.test.ts

All 11 tests should pass:

  • 6 tests for async tasker enabled scenarios (param passing, fallback behavior)
  • 3 tests for async tasker disabled scenarios (missing env vars)
  • 2 tests for error handling edge cases

Checklist

  • My code follows the style guidelines of this project
  • I have checked if my changes generate no new warnings

Human Review Checklist

  • Verify the mocks for @trigger.dev/sdk, ../constants, and ../redactError accurately represent the real dependencies
  • Confirm the dynamic import pattern (await import("./Tasker")) is appropriate for testing module-level state that depends on env vars
  • Check that process.env manipulation in tests is properly cleaned up in afterEach

Link to Devin run: https://app.devin.ai/sessions/628cc1149911452e91286c24b905eb3d
Requested by: @ThyMinimalDev

- Test that params are properly passed to async tasker methods
- Test that params are passed in correct order
- Test fallback to sync tasker when async tasker fails
- Test params are passed correctly to sync tasker fallback
- Test error handling when both taskers fail
- Test logging of dispatch information with args
- Test behavior when async tasker is disabled (missing env vars)
- Test error details logging

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@ThyMinimalDev ThyMinimalDev marked this pull request as ready for review January 18, 2026 11:00
@graphite-app graphite-app bot added the core area: core, team members only label Jan 18, 2026
@graphite-app graphite-app bot requested a review from a team January 18, 2026 11:00
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@ThyMinimalDev ThyMinimalDev enabled auto-merge (squash) January 18, 2026 11:03
@ThyMinimalDev ThyMinimalDev merged commit bca6615 into main Jan 18, 2026
83 of 84 checks passed
@ThyMinimalDev ThyMinimalDev deleted the devin/tasker-unit-tests-1768733482 branch January 18, 2026 11:06
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