temporalio / temporalio/sdk-typescript

result of env.run is not inferring type, returning `unknown`

Open
#1,601 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
917
Forks
224
Avg merge
3d 16h
Merged PRs (30d)
43

Description

What are you really trying to do?

I'm trying to test my activities using env.run and assert against the result.

Describe the bug

The return type of env.run is unknown when I would expect that it would be inferred from the activity.

Minimal Reproduction

https://codesandbox.io/p/devbox/l363c8

Environment/Versions

Macbook M2 Pro Sequoia 15.2
@temporal/testing 1.11.6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox minimal reproduction and inspect the @temporal/testing env.run entry point, focusing on how its return type is declared in version 1.11.6. Confirm that the activity's inferred result is exposed instead of unknown, and verify the reproduction's type assertion succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.