This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

fake_admin_firestore
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

Fake firebase admin/firstore

This package contains an in memory admin/firestore intended to be used in testing scenarii.

Usage

const firestore: Firestore = new FakeFirestore({
  accounts: {
    'user-id-1': {
      data: {
        name: 'cedric',
        age: 30,
        likes: ['cat', 'dog']
      },
      // sub collections
      collections: {
        pets: {
          'pet-id-1': {
            data: {
              name: 'Pita',
              age: 3,
              animal: 'cat',
            }
          }
        },
      },
    },
  }
});

Implemented features

  • Firestore:
  • collection
    • withConverter : this is a no operation conversion, it does nothing
    • add
    • get
    • doc
      • collection
      • get
      • create
      • set (FieldValue unsupported)
      • delete
    • where
      • limit
      • orderBy
  • collectionGroup
    • where
  • runTransaction: (no roll back)

Note on data conversion:

This library does not do data conversion, which is what we want: When dumping data to FakeFirestore(dataDump), the data is just a json object.

Contributing

The repository adopts a diy philosophy and does not accept issues, if you need something you'll have to make a Pull request.

Your pull request shall contain:

  • add tests for the added feature
  • add the feature (scoped, 1 PR == added 1 feature)
  • increment of the package.json semver
  • added entry in CHANGELOG.md

Readme

Keywords

none

Package Sidebar

Install

npm i fake_admin_firestore

Weekly Downloads

0

Version

0.0.5

License

ISC

Unpacked Size

122 kB

Total Files

62

Last publish

Collaborators

  • cedvdb