Skip to content

Support rawRequest in callable context #54

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 2 commits into from
Jan 3, 2020
Merged

Conversation

laurenzlong
Copy link
Contributor

Description

Resolves #41

Code sample

@laurenzlong laurenzlong requested a review from joehan December 26, 2019 23:23
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 changes

@@ -1,45 +1,72 @@
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 { 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it did... I had the wrong VSCode settings.... thanks for catching.

});
it('should run the wrapped onCall function and return result', async () => {
const test = fft();
const result = await test.wrap(cfToUpperCaseOnCall)({message: 'lowercase'});
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 test.wrap, to split up the arrange ,act, and assert steps of this test

expect(result).to.deep.equal({msg: 'LOWERCASE', from: 'abc'});
it('should accept auth params', async () => {
const test = fft();
const options = {auth: {uid: 'abc'}};
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 test.wrap, to split up the arrange ,act, and assert steps of this test

const test = fft();
const options = {
rawRequest: mockRequest,
};
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 test.wrap, to split up the arrange ,act, and assert steps of this test

@laurenzlong
Copy link
Contributor Author

@joehan Fixed. PTAL

@laurenzlong
Copy link
Contributor Author

Oh, actually I see you already approved. Thanks!

@laurenzlong laurenzlong merged commit c720e2f into master Jan 3, 2020
@laurenzlong laurenzlong deleted the ll-addrawrequest branch January 3, 2020 22:37
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.

Support rawRequest in callable context
2 participants