Advertisement
Guest User

Untitled

a guest
Apr 11th, 2023
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import { initializeTestEnvironment } from '@firebase/rules-unit-testing';
  2.  
  3. const clientConfig = {
  4. projectId: "platformsixx-next"
  5. };
  6.  
  7. const test = async () => await initializeTestEnvironment({
  8. ...clientConfig,
  9. firestore: {
  10. rules: `
  11. rules_version = '2';
  12. service cloud.firestore {
  13. match /{document=**} {
  14. allow read, write: if true;
  15. }
  16. }
  17. `,
  18. },
  19. });
  20.  
  21. export const db = test().then(async (app) => {
  22. console.log(app)
  23. return app.authenticatedContext("alice", { userId: "1", }).firestore();
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement