DenoDDeno
Powered by
IndustrialI
Deno•4y ago•
6 replies
Industrial

How do I patch a std api?

Hello.

This person posted in this command that they "patched" the
vm.isContext
vm.isContext
function to return false in order to get the
node:jsdom
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;
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]'
error: TypeError: Cannot assign to read only property 'isContext' of object '[object Module]'
GitHub
Testing Fresh Components · Issue #427 · denoland/fresh
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
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

How do I use std/log?
NeTTNNeTT / help
4y ago
Using std/crypto with x25519 crashes - How do i use node experimental modules instead?
chromaLTSCchromaLTS / help
2y ago