Skip to content
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 basedownloadcontroller unit tests #375

Merged
merged 3 commits into from
Jan 12, 2023
Merged

add basedownloadcontroller unit tests #375

merged 3 commits into from
Jan 12, 2023

Conversation

kdai7
Copy link
Contributor

@kdai7 kdai7 commented Jan 11, 2023

No description provided.

@kdai7 kdai7 requested a review from adamkingit January 11, 2023 20:54

module.exports = class MockDownloadController extends BaseDownloadController {
constructor(eventData, kubeData) {
let params = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let params = {};
const params = {};

const res = await this.kubeGetResource(ref);
return res;
try {
let uri = JSON.parse(reqOpt.uri);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let uri = JSON.parse(reqOpt.uri);
const uri = JSON.parse(reqOpt.uri);

const clone = require('clone');
const objectPath = require('object-path');

let kubeData = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let kubeData = {};
const kubeData = {};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gets reset in afterEach, so can't change to const

Comment on lines 286 to 289
let eventDataUpdate = clone(kubeData['RemoteResource'][0]);
eventDataUpdate = {
object: eventDataUpdate
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let eventDataUpdate = clone(kubeData['RemoteResource'][0]);
eventDataUpdate = {
object: eventDataUpdate
};
const eventDataUpdate = {
object: clone(kubeData['RemoteResource'][0])
};

Comment on lines 320 to 323
let eventDataUpdate = clone(kubeData['RemoteResource'][0]);
eventDataUpdate = {
object: eventDataUpdate
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let eventDataUpdate = clone(kubeData['RemoteResource'][0]);
eventDataUpdate = {
object: eventDataUpdate
};
const eventDataUpdate = {
object: clone(kubeData['RemoteResource'][0])
};

Copy link
Contributor

@adamkingit adamkingit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it overall. Minor suggestions.

@kdai7 kdai7 requested a review from adamkingit January 12, 2023 15:26
@kdai7 kdai7 merged commit 2e91560 into master Jan 12, 2023
@kdai7 kdai7 deleted the tests branch January 12, 2023 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants