hirosystems / clarinet

Write, test and deploy high-quality smart contracts to the Stacks blockchain and Bitcoin.
https://hiro.so/clarinet
GNU General Public License v3.0
290 stars 129 forks source link

Can't find variable `simnet` when running tests using `bun test` #1462

Closed matronator closed 1 month ago

matronator commented 1 month ago

Describe the bug I don't know if this is a bug with bun as I haven't tried running the tests with npm test to see if it also fails. But when using bun test it throws an error that it can't find variable simnet. I had to add it manually to the test file (import and init). So it seems like the vitest before hooks are not working properly, at least when using bun.

To Reproduce Steps to reproduce the behavior:

  1. Run clarinet contracts new <name>
  2. bun i
  3. bun test
  4. The test errors

Additional context here:

Jarred-Sumner commented 1 month ago

Note that bun test is not the same as npm run test, bun test uses bun:test. If you want to run the "test" package.json script with Bun, you can instead do bun run test.

matronator commented 1 month ago

Note that bun test is not the same as npm run test, bun test uses bun:test. If you want to run the "test" package.json script with Bun, you can instead do bun run test.

Oh my god, you're right! Oops, sorry, I guess this is not an issue then.

hugocaillard commented 1 month ago

Hey @matronator, let me know if you have any feedback jsong the clarinet-sdk with Bun (performances and everything).

@Jarred-Sumner Thank you so much for taking the time to answer here 🙏