-
Notifications
You must be signed in to change notification settings - Fork 59
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
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 changes
spec/providers/https.spec.ts
Outdated
@@ -1,45 +1,72 @@ | |||
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 { 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?
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.
Yes it did... I had the wrong VSCode settings.... thanks for catching.
spec/providers/https.spec.ts
Outdated
}); | ||
it('should run the wrapped onCall function and return result', async () => { | ||
const test = fft(); | ||
const result = await test.wrap(cfToUpperCaseOnCall)({message: 'lowercase'}); |
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 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'}}; |
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 test.wrap, to split up the arrange ,act, and assert steps of this test
const test = fft(); | ||
const options = { | ||
rawRequest: mockRequest, | ||
}; |
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 test.wrap, to split up the arrange ,act, and assert steps of this test
@joehan Fixed. PTAL |
Oh, actually I see you already approved. Thanks! |
Description
Resolves #41
Code sample