You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(callFirestore): support timestamps objects other than serverTimestamp - #132
* chore(docs): add note to README about how to use timestamps - #132
// Add other plugins/tasks such as code coverage here
74
74
75
-
return extendedConfig
75
+
return extendedConfig;
76
76
};
77
77
```
78
78
@@ -85,7 +85,8 @@ If you are interested in what drove the need for this checkout [the why section]
85
85
});
86
86
});
87
87
```
88
-
1. From the root of your project, start Cypress with the command `$(npm bin)/cypress open`. In the Cypress window, click your new test (`test_hello_world.js`) to run it.
88
+
89
+
1. From the root of your project, start Cypress with the command `$(npm bin)/cypress open`. In the Cypress window, click your new test (`test_hello_world.js`) to run it.
89
90
1. Look in your Firestore instance and see the `test_hello_world` collection to confirm that a document was added.
90
91
1. Pat yourself on the back, you are all setup to access Firebase/Firestore from within your tests!
@@ -548,6 +578,14 @@ When testing, tests should have admin read/write access to the database for seed
548
578
- [fireadmin.io][fireadmin-url] - A Firebase project management tool ([here is the source][fireadmin-source])
549
579
- [cv19assist.com](https://cv19assist.com) - App for connecting volunteers with at-health-risk population during the coronavirus pandemic. ([here is the source](https://github.com/CV19Assist/app))
550
580
581
+
## Troubleshooting
582
+
583
+
1. An error is coming from cypress mentioning "Error converting circular structure to JSON"
584
+
585
+
The issue is most likely due to a circular object, such as a timestamp, being included in data you are attempting to write to Firestore. Instead of using `firebase.firestore.FieldValue.serverTimestamp()` you should instead use `firebase.firestore.Timestamp.now()` or you would like to specify a certain date `firebase.firestore.Timestamp.fromDate(new Date('01/01/18'))`.
586
+
587
+
This comes from the fact that cypress stringifies values as it is passing them from the browser environment to the node environment through `cy.task`.
0 commit comments