-
Notifications
You must be signed in to change notification settings - Fork 229
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
A TypeError occurred when mocks BatchResponseContent via jest.spyOn() #514
Comments
@karamem0 There are no changes to BatchResponseContent in 3.0.0. |
@nikithauc Thank you for replying. Did you try to reproduce the issue? In actual there might be no changes to BatchResponseContent but something causes the error. |
@karamem0 I was able to reproduce the issue. Will have to look more into this to understand the cause of the issue. Thank you for reporting this! Are you able to use the |
@karamem0 aelbore/esbuild-jest#26 The typescript version was updated to version 4.x in Does the workaround suggested as follows work for you? |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
@nikithauc
|
My suggestion to avoid this error is as follows. before:
after:
|
@karamem0 Thanks for bringing this up! Can you explain the difference here and how that caused the error?
|
If build using
If build using
In this case, the |
Bug Report
Prerequisites
For more information, see the
CONTRIBUTING
guide.Description
Test failed when I upgraded SDK version from 2.2.1 to 3.0.0.
Console Errors: TypeError: Cannot redefine property: BatchResponseContent
Screenshots:
Steps to Reproduce
npm init
@microsoft/microsoft-graph-client@3.0.0
@types/jest@26.0.24
jest@26.6.0
ts-jest@26.5.6
typescript@4.3.5
index.test.ts
Expected behavior: Test passed.
Actual behavior: Test failed because cannot mock
BatchResponseContent
.Additional Context
It works with
@microsoft/microsoft-graph-client@2.2.1
. Was it any changes?Usage Information
Request ID - Value of the
requestId
field if you are receiving a Graph API error responseSDK Version - 3.0.0
The text was updated successfully, but these errors were encountered: