@@ -13,7 +13,18 @@ The testing library used by this repository is [`vitest`](https://vitest.dev).
1313By default, any Typescript (` .ts ` ) files located within a ` __tests__ ` folder are considered test files. This means that if ` vitest ` does not
1414detect any tests within that file, it will throw an error. This also includes any subdirectories under a ` __tests__ ` folder.
1515
16- Simply write your tests within a ` __tests__ ` folder:
16+ > [ !WARNING] Test File Naming
17+ > Right now any file ending with ` .ts ` or ` .tsx ` will be considered a test file. This is inconvenient, especially if you want to create a set of
18+ > common utilities to be used only for tests. Such a file might (_ READ: should_ ) not contain any tests, which will be considered by Vitest to be
19+ > an error.
20+ >
21+ > To remedy this, in the future, only files that end in ` .test.ts ` or ` .test.tsx ` will be considered test files. This will allow us to have regular
22+ > Typescript files located within ` __tests__ ` directories. This means you should use that naming convention instead when creating your test files.
23+ >
24+ > The current behaviour is retained for backwards compatibility since many Source modules' tests aren't written within ` .test.ts ` files. To see
25+ > examples of how to use this new system you can refer to how the tests for the buildtools are written.
26+
27+ Simply write your tests within a file within a ` __tests__ ` folder:
1728
1829``` ts
1930// curve/src/__tests__/index.ts
@@ -132,7 +143,7 @@ TODO tests still generate an entry in your test reports, but will be considered
132143To run tests for a given bundle or tab, simply run either of the following commands within the directory:
133144
134145``` sh
135- yarn buildtools test .
146+ yarn buildtools test --project .
136147yarn test # If your package.json has this script specified
137148```
138149
0 commit comments