D
Deno

help

How do I patch a std api?

IIndustrial10/1/2022
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;
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 ...
UUUnknown User10/1/2022
2 Messages Not Public
Sign In & Join Server To View
IIndustrial10/1/2022
I did it like this:
"https://deno.land/std@0.158.0/node/vm.ts": "./lib/std/node/vm.ts",
"https://deno.land/std@0.158.0/node/vm.ts": "./lib/std/node/vm.ts",
import * as vm from "std/node/vm.ts";

const isContext = () => false;

export default {
...vm,
isContext,
};
import * as vm from "std/node/vm.ts";

const isContext = () => false;

export default {
...vm,
isContext,
};
Almost have React component tests with React Testing Library working 馃 If i get that + a CSS-in-JS approach for Fresh then I can start using Fresh for Serious Business (tm) 馃檪

Looking for more? Join the community!

Recommended Posts
Monkey patch Broadcast Channel to send messages to current contextEssentially what I want to do is be able to connect to `new BroadcastChannel("test_channel");` whichDynamically imported module evaluation is still pendingI'm very confused on the error i put as the title because in my program i'm trying to just import soHow to setup CORS with serve? I get 403 forbidden.I've setup the following headers (OPTIONS response): ``` new Response(null, { status: 204, headeDynamic npm imports don't workHey there. It looks like dynamic imports don't work with `npm` specifiers. For example: ``` await iUnable to make local session persistence with Firebase Auth on Deno FreshHello I'm running a basic app for testing firebase auth. My implementation is as follows: - The finewbie help on deploying first project to denoI asked on deno github and was told to ask on discord: https://github.com/denoland/deno/discussions/How to exclude vendor directory from test coverage?https://deno.land/manual@v1.25.4/testing/coverage Here it says by default it will exclude `test\.(tsHow exactly do import maps work?My import map works but I don't understand how! ```"/": "./src/", "./": "./",``` If I import `/a/b/does not provide an export named... module importdoes anybody know whats going on, when i reload my page only sometimes i get this message : ``` ThWrite to virtual file pathIs it possible to provide virtual file paths so that another package writes a file to a variable in Request.body.getReader() into Uint8Array typed arrayis it possible to convert a `readableStream` into a `Uint8Array` ?serving two static folders and connecting to both with websocketsA lot of the youtube and medium resources available on setting serving static folders, and on settini need a regex that matches, from a double quote to a double quote and has two fullstop between it.i need a regex that matches, from a `"` to a `"` and has two `.` between it for example, `"fjhhdjkdimport a locel module from a webmoduleI have a module that i inport into my local scope and that module should also import a module from m