Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

firestore-jest-mock

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firestore-jest-mock - npm Package Compare versions

Comparing version 0.7.1 to 0.7.2

5

__tests__/full-setup.test.js

@@ -16,2 +16,3 @@ const { mockFirebase } = require('firestore-jest-mock');

mockBatchSet,
mockSettings,
} = require('../mocks/firestore');

@@ -51,4 +52,6 @@

test('We can start an application', async () => {
this.firebase.firestore();
const db = this.firebase.firestore();
db.settings({ ignoreUndefinedProperties: true });
expect(mockInitializeApp).toHaveBeenCalled();
expect(mockSettings).toHaveBeenCalledWith({ ignoreUndefinedProperties: true });
});

@@ -55,0 +58,0 @@

16

mocks/firestore.js

@@ -5,2 +5,3 @@ const mockCollectionGroup = jest.fn();

const mockSettings = jest.fn();
const mockCollection = jest.fn();

@@ -69,2 +70,7 @@ const mockDoc = jest.fn();

settings() {
mockSettings(...arguments);
return;
}
collection(collectionName) {

@@ -83,3 +89,4 @@ mockCollection(...arguments);

const pathArray = path.split('/');
// Ignore leading slash
const pathArray = path.replace(/^\/+/, '').split('/');
// Must be document-level, so even-numbered elements

@@ -140,3 +147,4 @@ if (pathArray.length % 2) {

query.mocks.mockGet(...arguments);
const pathArray = this.path.split('/');
// Ignore leading slash
const pathArray = this.path.replace(/^\/+/, '').split('/');

@@ -255,3 +263,4 @@ pathArray.shift(); // drop 'database'; it's always first

records() {
const pathArray = this.path.split('/');
// Ignore leading slash
const pathArray = this.path.replace(/^\/+/, '').split('/');

@@ -319,2 +328,3 @@ pathArray.shift(); // drop 'database'; it's always first

mockSet,
mockSettings,
mockBatchDelete,

@@ -321,0 +331,0 @@ mockBatchCommit,

{
"name": "firestore-jest-mock",
"version": "0.7.1",
"version": "0.7.2",
"description": "Jest helper for mocking Google Cloud Firestore",

@@ -40,10 +40,10 @@ "author": "",

"babel-eslint": "^10.0.3",
"babel-jest": "^24.8.0",
"babel-jest": "^26.6.3",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-jest": "^23.6.0",
"firebase": "^6.3.1",
"firebase-admin": "^8.3.0",
"firebase": "^8.1.2",
"firebase-admin": "^9.4.1",
"husky": "^4.2.1",
"jest": "^24.8.0",
"jest": "^26.6.3",
"jest-watch-typeahead": "^0.3.1",

@@ -50,0 +50,0 @@ "lint-staged": "^10.0.2",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc