Skip to content

Add prototype for Firestore module #948

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

MathBunny
Copy link
Contributor

  • Adds prototype for a Firestore module
    • Unfortunately, it requires manually re-exporting each type from Firestore individually

Next steps: explore if CI can determine when a type is not exported

@MathBunny
Copy link
Contributor Author

Not sure why GitHub isn't updating the PR with the new commit but I since added two things:

  1. Invoked the unit tests by adding firestore.spec.ts to index.ts (they actually weren't running before :) )

  2. Unit test for verifying if all the props from the cloudFirestore (@google-cloud/firestore) exist in the admin firestore (/src/firestore), with the exception of two whitelisted props.

describe('typing re-exports', () => {
    const whitelistedProps = new Set(['DocumentChange', 'default']);
    const adminProps = new Set();

    for (const key in adminFirestore) {
      adminProps.add(key);
    }

    for (const key in cloudFirestore) {
      expect(adminProps.has(key) || whitelistedProps.has(key.toString())).to.be.true;
    }
  });

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