-
Notifications
You must be signed in to change notification settings - Fork 34
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
lz4 check fails in jest #270
Comments
@gabegorelick Yes, this check is needed because otherwise |
That doesn't mean it has to be an
I don't really disagree with this; fixing the issue by modifying your library would definitely be going out of your way to make it work with the quirks of certain widely-used tools. But…maybe that's not such a terrible thing? After all it's Jest, not some random test framework written by one guy and used in-house by one small company. It is a workaround for one particular framework, but it's one of the most widely-used, so it's a workaround that in the longer term is likely to help a lot of your users. |
I would also suggest that something like |
The optional
lz4
dependency is currently loaded as follows:See https://github.com/databricks/databricks-sql-nodejs/blob/56bd0d90d61a2bdff4e62cd55ebcb8d070fa60e2/lib/utils/lz4.ts.
However, this fails when running under Jest due to jestjs/jest#2549 (see also jestjs/jest#11808). Namely, the
err instanceof Error
check returnsfalse
since Jest substitutes its own objects for JS globals. This causes calling code to fail with a ModuleNotFound error.Is the
err instanecof Error
check really needed here? Can it be removed?The text was updated successfully, but these errors were encountered: