-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
protobuf.js 6.10.0 is incompatible with jest #1443
Comments
Closed
+1 |
1 similar comment
+1 |
+1 google pubsub module also depends on protobuf.js, it will effect a lot project, I think. 😅 https://github.com/googleapis/nodejs-pubsub/blob/master/package.json#L63 |
+1 |
2 similar comments
+1 |
+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
protobuf.js version: 6.10.0
How to reproduce
See: https://github.com/starkwang/jest-protobufjs-incompatible
Reason
Jest has a mock
global
for each test. It is not a[object global]
but a[object Object]
So the mock
global
will break theutil.global
in protobuf.js:protobuf.js/src/util/minimal.js
Lines 29 to 32 in 07e8185
And
util.isNode
will returnfalse
:protobuf.js/src/util/minimal.js
Line 55 in 07e8185
And then the
loadSync()
will throw an error:protobuf.js/src/root.js
Lines 244 to 248 in 07e8185
The text was updated successfully, but these errors were encountered: