-
Notifications
You must be signed in to change notification settings - Fork 8
[MV-400] Add Jest and unit test workflow #86
Conversation
return { | ||
connect: async (): Promise<void> => { | ||
return new Promise<void>((resolve) => { | ||
resolve(); |
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.
can you put this in the mocks directory? also it's the same as joinRoom, so maybe de-duplicate this
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.
Done.
src/__mocks__/index.tsx
Outdated
// noop | ||
}; | ||
|
||
export enum VideoQuality { |
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.
is there some way to import this from the real index.tsx
? we're going to forget to change this here
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.
Added import and export for all of the enums
src/__mocks__/index.tsx
Outdated
|
||
export const useMembraneServer = NOOP; | ||
export const useRoomParticipants = NOOP; | ||
export const useCameraState = NOOP; |
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.
It would be better if the hooks returned objects with mocked data / functions. Users don't just call the hooks, they also read something from them
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.
Done.
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.
Looks good 👏
This changes introduces basic tests and github workflow. Following PRs will contain more unittests.