-
Notifications
You must be signed in to change notification settings - Fork 5.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
deno test
doesn't use the specified compilerOptions.lib
#14565
Comments
This is an actual runtime error and not TypeScript error. If you configure |
Thanks @dsherret . Is there a workaround? It would be nice if I could unit test front-end code without needing to import a vendor library. |
@RobertAKARobin FYI I opened denoland/docs#103 to improve our documentation on this topic. |
Tiny example repo:
https://github.com/RobertAKARobin/deno-test-err
It consists of:
Steps to reproduce
deno bundle index.ts
. Observe it compiles and completes successfully.deno test index.test.ts
Expected result
deno test
completes successfully, just likedeno bundle
.Actual result
deno test
fails with a fatal error:deno test
doesn't "know" aboutdocument
, which indicates it is not respecting that the configuration file'scompilerOptions.lib
includes"dom"
.If I add the
--compat
option...:...then the error changes:
How can I write unit tests that include the DOM API?
The text was updated successfully, but these errors were encountered: