Understand the tsd Order of Operations
mainWhen running tsd, the tool follows these steps to find and execute tests:
- Locate
package.json: Must be in the current or specified directory. - Find
.d.tsfile: Checks thetypesfield inpackage.json, or manually specified path. If neither is found, it looks for a file named after themainfield inpackage.jsonorindex.d.ts. - Find
.test-d.tsfiles: Searches the project root, a specific folder (default:test-d), or files specified via CLI/programmatically. - Compile and Analyze: Runs files through the TypeScript compiler and performs static analysis.
- Verify Assertions: Checks errors against your
expect...assertions and reports mismatches.