-
Notifications
You must be signed in to change notification settings - Fork 12
Fix tests #533
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
Fix tests #533
Conversation
Signed-off-by: Nik Nasr <nik@restate.dev>
@@ -41,8 +41,7 @@ | |||
}, | |||
"devDependencies": { | |||
"tsx": "^4.15.7", | |||
"@restatedev/restate-sdk-testcontainers": "^1.5.4", | |||
"testcontainers": "^10.24.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When GenericContainer
was imported from two separate modules (restate-sdk-examples and restate-sdk-testcontainers), it created two distinct versions of the class—causing issues with testcontainers. To resolve this, I introduced RestateGenericContainer
as a single, unified reference.
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-assignment | ||
const handler = greeterFoo["service"]["greet"]; | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call | ||
expect(await handler({}, "abc")).toEqual("abc"); | ||
// @ts-ignore | ||
expect(await greeterFoo.service.greet({}, "abc")).toEqual("abc"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value of this
depends how a function is called rather than how it was created :)
extracting the method and calling it directly makes this
undefined
.
@@ -167,6 +167,11 @@ export class RestateTestEnvironment { | |||
export type TypedState = Record<string, any>; | |||
export type UntypedState = { _: never }; | |||
|
|||
export class RestateGenericContainer extends GenericContainer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding here is that you can't get away without adding a new public API?
If not, then name this RestateContainer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately not. done ✅
Signed-off-by: Nik Nasr <nik@restate.dev>
No description provided.