-
Notifications
You must be signed in to change notification settings - Fork 409
Add toJSON method to Remote Config Template implementation #842
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
Adding unit tests, please hold the review. |
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. Just a couple of suggestions.
src/remote-config/remote-config.ts
Outdated
conditions: this.conditions, | ||
parameters: this.parameters, | ||
parameterGroups: this.parameterGroups, | ||
etag: this.etagInternal, |
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 we use this.etag
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.
Good catch! Thanks!
expect(cond.expression).to.equal('device.os == \'ios\''); | ||
expect(cond.tagColor).to.equal(TagColor.BLUE); | ||
|
||
expect(JSON.stringify(template)).equals(JSON.stringify(REMOTE_CONFIG_RESPONSE)); |
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 parsed = JSON.parse(JSON.stringify(template));
expect(parsed).deep.equal(REMOTE_CONFIG_RESPONSE);
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.
Updated!
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 👍
toJSON()
method toRemoteConfigTemplateImpl
to correctly serialize the JSON object