firestore-jest-mock
Advanced tools
Comparing version 0.7.1 to 0.7.2
@@ -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 @@ |
@@ -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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115180
1653