2

On my package.json I have this script "test": "hardhat test".

I would like to make another one to only run tests from a subfolder, and not the entire test suite. Something like "test:single": "hardhat test ./tests/subfolder/${runThisOne}" and call it like yarn test:single coolTest which would result in yarn test:single ./tests/subfolder/coolTest. Is this possible?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Eduardo Robles
  • 495
  • 1
  • 5
  • 7

1 Answers1

-1

For Npm use this,

"scripts":{
   "test": "hardhat test",
   "sale": "hardhat test test/Sale.js" // here test will run sale.js 
}
vimuth
  • 5,064
  • 33
  • 79
  • 116
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 04 '22 at 12:13
  • Your answer is just the way of a static path. – Chase Choi Dec 26 '22 at 02:40