-
Notifications
You must be signed in to change notification settings - Fork 409
Add integration tests for Remote Config #826
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
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.
Mostly looks good. Few suggestions on eliminating redundant tests and keeping things simple.
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. Let's move the argument validation tests into unit tests so they get tested more often.
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.
Couple of points to improve on.
}); | ||
|
||
INVALID_CONDITIONS.forEach((invalidConditions) => { | ||
console.log(inputTemplate); |
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.
Please remove
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!
}); | ||
|
||
// validate input template | ||
testInputTemplate((t: RemoteConfigTemplate) => { remoteConfig.validateTemplate(t); }); |
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't you just do testInputTemplate(remoteConfig.validateTemplate);
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.
I tried that but it gives me the following type error. Not quite sure why.
testInvalidInputTemplates(remoteConfig.validateTemplate);
^
TypeError: Cannot read property 'validateTemplate' of undefined
}); | ||
}); | ||
|
||
function testInputTemplate(rcOperation: Function): void { |
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.
Use a more descriptive name. Perhaps testInvalidInputTemplates()
?
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.
LGTM
validateTemplate()
andpublishTemplate()
functions