-
Notifications
You must be signed in to change notification settings - Fork 41
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
Do not download model again #107
Conversation
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.
would be nice (as for many others PR) to add more unit tests
35f3046
to
9376725
Compare
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
vi.spyOn(fs, 'readdirSync').mockImplementation((dir: string): any => { | ||
// TODO(feloy): fix any |
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 difficulty with readdirSync is that it returns either Dirent[] or string[] depending on the options passed. I'm not sure how to handle this without using any 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.
const readdirSyncMock: MockInstance<[path: fs.PathLike], string[]| fs.Dirent[]> = vi.spyOn(fs, 'readdirSync') as unknown as MockInstance<[path: fs.PathLike], string[]| fs.Dirent[]>;
readdirSyncMock.mockImplementation((path: fs.PathLike) => {
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.
(that said on unit test I'm fine to use any
type)
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.
Thanks
6a0c083
to
8f39872
Compare
eec5015
to
ccb3533
Compare
ccb3533
to
0224f4f
Compare
Generalize test requirements
Fixes #18