Skip to content

chore: Bump jest to v30 #3161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

chore: Bump jest to v30 #3161

wants to merge 3 commits into from

Conversation

teogeb
Copy link
Contributor

@teogeb teogeb commented Jun 25, 2025

Async dispose

Upgrade caused multiple errors about missing [Symbol.asyncDispose]() in npm run check:

  ../../node_modules/typescript/lib/lib.esnext.disposable.d.ts:40:5
    [Symbol.asyncDispose](): PromiseLike<void>;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    '[Symbol.asyncDispose]' is declared here.

test/unit/PushPipeline.test.ts:108:15 - error TS2345: Argument of type 'PushPipeline<StreamMessage, StreamMessage>' is not assignable to parameter of type 'IPushBuffer<Error | StreamMessage, Error | StreamMessage>'.
  Property '[Symbol.asyncDispose]' is missing in type 'PushPipeline<StreamMessage, StreamMessage>' but required in type 'AsyncGenerator<Error | StreamMessage, any, any>'.

Not sure how esnext types are used (the sdk uses es2021 in tsconfig.jest.json).

Added simple implementations of [Symbol.asyncDispose]() to PushBuffer and PipeLine. That solved the issue.

Bucket test

Changed Bucket to throw TypeError instead of generic Error. Now functionality matches what we assert in the Bucket.test.ts.

Future improvements

Add tests for the [Symbol.asyncDispose]() implementations (i.e. the correct cleanup actually happens)

@github-actions github-actions bot added network Related to Network Package test-utils Related to Test Utils Package dht Related to DHT package sdk labels Jun 25, 2025
@github-actions github-actions bot added the node label Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dht Related to DHT package network Related to Network Package node sdk test-utils Related to Test Utils Package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant