-
Notifications
You must be signed in to change notification settings - Fork 541
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
Add tests and separate from class validation merge methods #363
base: story/load-multiple-mcaps-r1
Are you sure you want to change the base?
Add tests and separate from class validation merge methods #363
Conversation
I don't understand why the MultiIterableSource.ts is considered as 0% tested. I believe that it is something related to how sonar is configured. I suggest to merge it and check when we point to merge to main if it will be considered. |
@@ -36,7 +44,7 @@ export class MultiIterableSource<T extends IIterableSource, P> implements IItera | |||
this.SourceConstructor = SourceConstructor; | |||
} | |||
|
|||
private async loadMultipleSources(): Promise<Initalization[]> { | |||
private async loadMultipleSources(): Promise<Initialization[]> { | |||
const { type } = this.dataSource; | |||
|
|||
const sources: IIterableSource[] = |
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.
suggestion: This branching should be tested. Since this is a private method, I would suggest testing where its behaviour is expected. Therefore, during initialization.
Tests would look something like the following:
it("source type is file", async () => {
dataSource = {
type: "files",
files: [new Blob(), new Blob()],
};
const multiSource = new MultiIterableSource(dataSource, mockSourceConstructor);
await multiSource.initialize();
expect(mockSourceConstructor).toHaveBeenCalledWith(expect.objectContaining({ type: "file" }));
});
it("source type is url", async () => {
dataSource = {
type: "urls",
urls: ["my.url/"],
};
const multiSource = new MultiIterableSource(dataSource, mockSourceConstructor);
await multiSource.initialize();
expect(mockSourceConstructor).toHaveBeenCalledWith(expect.objectContaining({ type: "url" }));
});
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
…origin' into feature/validation-of-multiple-mcaps-and-tests
…f-multiple-mcaps-and-tests
|
User-Facing Changes
Added validation for merging MCAP files and introduced unit tests for the load-multiple-mcaps story.
Description
Checklist