Skip to content

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

Merged
merged 4 commits into from
Jan 3, 2020

Conversation

laurenzlong
Copy link
Contributor

@laurenzlong laurenzlong commented Dec 26, 2019

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

@laurenzlong laurenzlong changed the title Add unit tests for makeDataSnapshot and makeDocumentSnapshot and update dependencies Support null value in makeDataSnapshot and update dependencies Dec 27, 2019
Copy link
Contributor

@joehan joehan left a 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

@@ -21,11 +21,11 @@
// SOFTWARE.

import 'mocha';
import { expect } from 'chai';
import {expect} from 'chai';
Copy link
Contributor

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');
Copy link
Contributor

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');
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

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

@laurenzlong laurenzlong merged commit d2afd7a into master Jan 3, 2020
@laurenzlong laurenzlong deleted the ll-fix branch January 3, 2020 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants