GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Implement `AsyncDisposable` to support TS 5.2's `using` by cristianrgreco · Pull Request #1080 · testcontainers/testcontainers-node Conversation
|
✅ Deploy Preview for testcontainers-node ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This PR adds support for TypeScript 5.2's using keyword, implementing automatic resource disposal for test containers. The changes modernize resource management by replacing manual await container.stop() calls with automatic disposal when containers go out of scope.
AsyncDisposable interfaceawait using for automatic resource cleanupCopilot reviewed 73 out of 73 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/testcontainers/src/test-container.ts | Extends StartedTestContainer interface with AsyncDisposable |
| packages/testcontainers/src/generic-container/started-generic-container.ts | Implements Symbol.asyncDispose for containers |
| packages/testcontainers/src/network/network.ts | Implements AsyncDisposable for networks |
| packages/testcontainers/src/utils/test-helper.ts | Updates helper to return disposable event stream |
| Test files across all modules | Replace manual cleanup with await using declarations |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
usingAsyncDisposable to support TS 5.2's using
| async [Symbol.asyncDispose]() { | ||
| await this.startedTestContainer[Symbol.asyncDispose](); | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@cristianrgreco Shouldn't this call this.stop?
| async [Symbol.asyncDispose]() { | |
| await this.startedTestContainer[Symbol.asyncDispose](); | |
| } | |
| async [Symbol.asyncDispose]() { | |
| await this.stop(); | |
| } |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.