IndustrialI
Deno4y ago
6 replies
Industrial

How do I patch a std api?

Hello.

This person posted in this command that they "patched" the vm.isContext function to return false in order to get the node:jsdom library to work: https://github.com/denoland/fresh/issues/427#issuecomment-1251918545

I am wondering how they did that.

I tried this:
import * as vm from "std/node/vm.ts";
vm.isContext = () => false;


But this throws the error:
error: TypeError: Cannot assign to read only property 'isContext' of object '[object Module]'
GitHub
Issue: Deno testing suit documentation does not elaborate on how to render and test components. Discussion: I have been having trouble finding ways to conduct unit tests for Fresh components. When ...
Testing Fresh Components · Issue #427 · denoland/fresh
Was this page helpful?