-
Notifications
You must be signed in to change notification settings - Fork 59
Support null value in makeDataSnapshot and update dependencies #53
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after some small style tweaks
spec/index.spec.ts
Outdated
@@ -21,11 +21,11 @@ | |||
// SOFTWARE. | |||
|
|||
import 'mocha'; | |||
import { expect } from 'chai'; | |||
import {expect} from 'chai'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, it looks like the rest of this repo has spaces around single element { objects } - for example, https://github.com/firebase/firebase-functions-test/blob/master/src/index.ts#L24. Firebase-tools also keeps this style: https://github.com/firebase/firebase-tools/blob/master/src/commands/apps-list.ts#L5
I think your linter might have broken this throughout the files in this PR - can you switch this back?
it('produces the right snapshot with makeDataSnapshot', async () => { | ||
const snapshot = makeDataSnapshot({ | ||
foo: 'bar', | ||
}, 'path'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - add a newline after this to separate the act and assert steps of this test.
}); | ||
|
||
it('should allow null value in makeDataSnapshot', async () => { | ||
const snapshot = makeDataSnapshot(null, 'path'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - add a newline after this line to separate the act and assert steps of this test.
|
||
describe('providers/firestore', () => { | ||
it('produces the right snapshot with makeDocumentSnapshot', async () => { | ||
const test = fft(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - add a newline after this line and after you call makeDocumentSnapshot, to split up the arrange ,act, and assert steps of this test
}); | ||
|
||
it('should allow empty document in makeDocumentSnapshot', async () => { | ||
const test = fft(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - add a newline after this line and after you call makeDocumentSnapshot, to split up the arrange ,act, and assert steps of this test
Description
Add support for null value in data snapshot (#48), added unit tests for creating Firestore DocumentSnapshot and RTDB DataSnapshot, also updated dependencies to more modern versions. (Note: peer dependencies are updated less aggressively than dev dependencies, since dev dependencies are what a contributor of this library must install, whereas peer dependencies are what users of this library must use)
Code sample