near / near-workspaces-js

Write tests once, run them both on NEAR TestNet and a controlled NEAR Sandbox local environment
https://near.github.io/near-workspaces-js/
GNU General Public License v3.0
42 stars 22 forks source link

feat!(jest): add testMatch to default config #59

Closed chadoh closed 2 years ago

chadoh commented 2 years ago

Jest's default testMatch will find ALL files in a __tests__ directory.

Given the way we set up projects for people, this makes it hard to extract helper files. In https://github.com/near/near-sdk-rs/pull/569, I experienced this first-hand: I wanted to create a utils.ts file, and that required me to set up a whole jest.config.js and figure out how to extend the one from near-runner-jest.

With this change, people can just create utility files right in their __tests__ directory. The only downside is for Jest power users who might expect to be able to omit the spec or test from their test filenames.