Open nex3 opened 1 year ago
@nex3 Do you happen to know what aspect of the generated code is incompatible with Jest? I haven't used the framework before.
Ah, it was right in front of me: it looks like window
is the immediate issue.
querying for globalThis
first is probably reasonable typeof window != "undefined" && window
would also work i suppose
This is the same issue as https://github.com/protocolbuffers/protobuf/issues/9152, which was notionally fixed in https://github.com/protocolbuffers/protobuf/pull/9156. However, it seems that as of 3.20.3 the output is (still? again?) the Jest-incompatible
For now I've rolled back to 3.11.2 which emits the compatible
but this isn't a great long-term solution.