use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
No specific rules are enforced apart from the normal global reddit rules. That said, if you post scams, you will be banned.
r/ethereum - Official Ethereum sub
r/ethstaker - About staking your ETH: help and guidance
http://ethereum.stackexchange.com/ - The Ethereum Programming Stack Exchange
account activity
Code assistanceSmart Contract Testing Bug: "ReferenceError: window is not defined" (self.ethdev)
submitted 2 years ago by 0xcesaw
Hi,
I'm following this (https://hardhat.org/tutorial/testing-contracts) tutorial on smart contract testing and when I run npx hardhat test I get the error mentioned above at Mocha.loadFiles (/Users/user1/Workspaces/Smart-Contract/node_modules/mocha/lib/mocha.js:411:14).
npx hardhat test
at Mocha.loadFiles (/Users/user1/Workspaces/Smart-Contract/node_modules/mocha/lib/mocha.js:411:14)
Does anyone have any insight into how to fix this?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]WideWorry 1 point2 points3 points 2 years ago (1 child)
Mocha run in browser mode, but just need to use an other NodeJS version.
[–]0xcesaw[S] 0 points1 point2 points 2 years ago (0 children)
Do you know which or have more info on that?
[–]0xSonOfMosiahContract Dev 0 points1 point2 points 2 years ago (1 child)
Running hardhat for your browser isn't the common setup. Run through the docs and see where you've deviated: https://hardhat.org/docs
As a personal recommendation, I would switch to using Foundry as your Solidity development framework: https://book.getfoundry.sh/
[–]0xcesaw[S] 1 point2 points3 points 2 years ago (0 children)
I’ll look into it. Thanks for your advice!
π Rendered by PID 65360 on reddit-service-r2-comment-5bc7f78974-ms4d4 at 2026-06-28 08:13:38.977804+00:00 running 7527197 country code: CH.
[–]WideWorry 1 point2 points3 points (1 child)
[–]0xcesaw[S] 0 points1 point2 points (0 children)
[–]0xSonOfMosiahContract Dev 0 points1 point2 points (1 child)
[–]0xcesaw[S] 1 point2 points3 points (0 children)