Open ben-hn opened 2 months ago
What do you need that using the public withUsername/password
doesn't provide?
I'm wanting to use the using
command brought in with Typescript 5.2, I thought my only options were to extend the existing class, wait for you to add
[Symbol.dispose]: async () => {
await (await container).stop();
},
to StartedTestContainer (which would need a typescript bump), or now I realise I can just use a wrapper with
export const DisposableContainer = async <
T extends Promise<StartedTestContainer>,
>(
container: T,
) => {
return Object.assign(await container, {
[Symbol.dispose]: async () => {
await (await container).stop();
},
});
};
Which might be helpful for others.
Expected Behaviour I should be able to extend the PostgreSqlContainer without issues as follows
Actual Behaviour I'm required to add
Testcontainer Logs Not relevant
Steps to Reproduce
Environment Information