Skip to content
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

Problem testing with firebase.firestore.FieldValue.serverTimestamp() #191

Open
VictorUvarov opened this issue Aug 6, 2021 · 0 comments
Open

Comments

@VictorUvarov
Copy link

I migrated over from @firebase/testing to @firebase/rules-unit-testing and now all of my tests that use firebase.firestore.FieldValue.serverTimestamp() are failing.

Articles collection
       Should allow an admin to update an article:
     Error: Value for argument "data" is not a valid Firestore document. Detected an object of type "FieldValue" that doesn't match the expected instance (found in field "created_at"). Please ensure that the Firestore types you are using are from the same NPM package.)
      at validateUserInput (node_modules/@google-cloud/firestore/build/src/serializer.js:332:15)
      at Object.validateUserInput (node_modules/@google-cloud/firestore/build/src/serializer.js:269:13)
      at validateDocumentData (node_modules/@google-cloud/firestore/build/src/write-batch.js:588:18)
      at WriteBatch.set (node_modules/@google-cloud/firestore/build/src/write-batch.js:247:9)
      at Transaction.set (node_modules/@google-cloud/firestore/build/src/transaction.js:178:26)
      at /Users/victoruvarov/work/tive/tive-backend/test/articles_collection.spec.js:216:19
      at Transaction.runTransaction (node_modules/@google-cloud/firestore/build/src/transaction.js:333:33)
      at async Context.<anonymous> (test/articles_collection.spec.js:215:5)

imports

const firebase = require("@firebase/rules-unit-testing");
const fs = require("fs");
const http = require("http");

dependencies

"devDependencies": {
    "@firebase/rules-unit-testing": "^1.3.13",
    "firebase-admin": "^9.11.0",
    "firebase-tools": "^9.16.0",
    "mocha": "^8.4.0"
  }
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

No branches or pull requests

1 participant