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.
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 wholejest.config.js
and figure out how to extend the one fromnear-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 thespec
ortest
from their test filenames.