You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
Hey! Not sure how relevant this is but wanted to share anyway.
I was tasked with writing some tests for the docusaurus site. These tests are supposed to protect us from breaking changes in the documentation site.
I am testing the functions that are being called in the quickstart.js file. I was running across a bunch environmental stuff.
Since I am testing the browser export of Web5, I needed to create a jest set up config to import some of the native browser APIs.
// needed to install a fake-indexddbconstfakeIndexedDB=require("fake-indexeddb");// added it to the global scopeglobal.indexedDB=fakeIndexedDB.default;global.TextEncoder=require("util").TextEncoder;// needed to set this up for crytpo digest mockglobal.self=global.self||{};jest.setTimeout(10000);Object.defineProperty(global.self,"crypto",{value: {subtle: {digest: jest.fn().mockResolvedValue(newUint8Array([1,2,3,4])),},getRandomValues: function(buffer){letlen=buffer.length;while(len--){buffer[len]=Math.floor(Math.random()*256);}returnbuffer;},},writable: true,configurable: true,});// add node-fetch to global scope(async()=>{constnodeFetch=awaitimport("node-fetch");global.fetch=nodeFetch.default||nodeFetch;})();
I am now running a test to create a did, however I get this error:
Cannot find module '@ipld/dag-cbor' from 'node_modules/.pnpm/@TBD54566975[email protected]/node_modules/@tbd54566975/dwn-sdk-js/dist/cjs/src/utils/cid.js'
I'm still in the middle of troubleshooting this, but would like to know your thoughts if you have any.
The text was updated successfully, but these errors were encountered:
I was going down the list and after each time I added a new map, a new one came up. I gave up realizing I'd have to do this for tons of libraries and at the end of the day, I'm not 100% sure this would work in the end after all.
Hey! Not sure how relevant this is but wanted to share anyway.
I was tasked with writing some tests for the docusaurus site. These tests are supposed to protect us from breaking changes in the documentation site.
I am testing the functions that are being called in the
quickstart.js
file. I was running across a bunch environmental stuff.Since I am testing the browser export of Web5, I needed to create a jest set up config to import some of the native browser APIs.
I am now running a test to create a
did
, however I get this error:Cannot find module '@ipld/dag-cbor' from 'node_modules/.pnpm/@TBD54566975[email protected]/node_modules/@tbd54566975/dwn-sdk-js/dist/cjs/src/utils/cid.js'
I'm still in the middle of troubleshooting this, but would like to know your thoughts if you have any.
The text was updated successfully, but these errors were encountered: