Carere
Carere10mo ago

How can I run `deno test` on all `*.spec.ts` files contains in a specific directory ?

Everything is in the question, it seems very strange that we do not have a pattern option to specify we wanna run all test contains in a directory
1 Reply
Deno AI Helper
Deno AI Helper10mo ago
According to the documentation, you can run tests in a specific directory by passing the directory path to the deno test command. However, the documentation specifies that the command will run all tests in the directory that match the glob {*_,*.,}test.{ts, tsx, mts, js, mjs, jsx}. If you want to run tests only on *.spec.ts files, you might need to rename your test files to match the glob pattern that Deno uses to identify test files. Here's an example of how you can run tests in a specific directory:
deno test path/to/your/directory/
deno test path/to/your/directory/
This command will run all tests in the specified directory and its subdirectories that match the glob pattern. Please note that this information is based on the documentation and Deno might not support running tests with a custom glob pattern at the moment.