Set fdcrealtime flag to true by default and modify tests.#10279
Set fdcrealtime flag to true by default and modify tests.#10279itsrakhil wants to merge 2 commits intofirebase:mainfrom
fdcrealtime flag to true by default and modify tests.#10279Conversation
…eneration configurations
There was a problem hiding this comment.
Code Review
This pull request enables the Firebase Data Connect realtime feature by default and updates the SDK generation logic to inject a clientCache configuration. The review feedback correctly identifies a violation of the repository's style guide regarding the use of 'any' as an escape hatch in unit tests, suggesting the use of Chai's nested property assertions instead.
| it("should NOT inject clientCache if fdcrealtime is disabled", () => { | ||
| sinon.stub(experiments, "isEnabled").withArgs("fdcrealtime").returns(false); | ||
| addSdkGenerateToConnectorYaml(connectorInfo, connectorYaml, app); | ||
| expect((connectorYaml.generate?.javascriptSdk as any)[0].clientCache).to.be.undefined; |
There was a problem hiding this comment.
Avoid using as any to access properties in tests. This violates the repository style guide which discourages the use of any as an escape hatch. You can use Chai's nested property assertions to achieve the same result in a more readable manner without bypassing type safety via any.
| expect((connectorYaml.generate?.javascriptSdk as any)[0].clientCache).to.be.undefined; | |
| expect(connectorYaml.generate?.javascriptSdk).to.have.nested.property("[0].clientCache").that.is.undefined; |
References
- Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)
fredzqm
left a comment
There was a problem hiding this comment.
LG.
Please double check with @aashishpatil-g on whether we should tweak the default client_cache configs yaml.
Checked with @aashishpatil-g offline to confirm that the current setup is good. |
No description provided.