-
Notifications
You must be signed in to change notification settings - Fork 71
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
feat: add an option to disable payment detection in the request client #201
Conversation
…estNetwork into get-balance-optional
@@ -1461,6 +1461,83 @@ describe('index', () => { | |||
); | |||
sinon.restore(); | |||
}); | |||
|
|||
it('can skip the get the balance of a request', async function(): Promise<void> { |
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.
I would add a check that getBalance
was not called. We do this to improve performance, if the balance
field is null but getBalance
was still called, we didn't achieve much!
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.
I don't know how to test expecting putting private paymentNetwork: PaymentTypes.IPaymentNetwork | null = null;
to public in the request class.
@rittme what do you think ?
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.
after rethinking it, We return the previous balance to avoid loosing information
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.
I don't understand. Can't you add a spy to getBalance
and make sure it's not called?
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.
I think so too
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.
the payment network is nested in the class as private.
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.
private stuff sucks because of this :/ If we're sure we're not calling getBalance, I'm fine with leaving like this for now.
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.
Can't you solve this with any ?
@@ -1461,6 +1461,83 @@ describe('index', () => { | |||
); | |||
sinon.restore(); | |||
}); | |||
|
|||
it('can skip the get the balance of a request', async function(): Promise<void> { |
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.
I don't understand. Can't you add a spy to getBalance
and make sure it's not called?
No description provided.