back to home

jest-community / jest-runner-tsd

Jest runner to test TypeScript typings

View on GitHub
78 stars
0 forks
9 issues

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing jest-community/jest-runner-tsd in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/jest-community/jest-runner-tsd)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

> Run your TypeScript type tests using Jest. **Note:** the is using instead of . Both of them have the same type testing logic, but makes it easier to test projects written in TypeScript (or types generated by your library). Most important differences (for the full list see repo): • has no additional rules or checks; • is used to discover test files; • provides configuration for TS compiler. For details see Configuration section; • the type assertions must be imported from package. Install Remember to install package. It is a required peer dependency. Note that will be used to compile type tests. Generally it is recommended to match versions of and in a project, but you may choose to test on different version too. Configuration Jest First of all, you should configure Jest to discover your test files. For example, if the files have suffix and live inside directories, set up like this: TS Compiler Your test files will be compiled using the TypeScript compiler (similar to ), but, instead of emitting JS code, will analyze types and diagnostics returned by the compiler. To compile each test file, will read the nearest and will pass the configuration to the compiler. Hence, you may have a configuration for the whole project, or a group of test files, or just a particular test file. For example, if your project already includes a in the root directory, but you prefer to have different configuration for testing, simply add another to a directory with the test files. It may override or extend your root configuration. **Tip:** run to print the configuration which applies to the test files. **Note:** if is not found, the compiler will fall back to the default configuration. Optionally Strict Just like TypeScript, is optionally strict. In contrary, the vanilla is strict by default. If you are migrating your test suite, remember to set in . The assertion in this example fails with , but passes with . Writing Tests Let's say you defined a type: It is relatively complex, so it is worth adding a type test to prevent mistakes and regression in the future: **Tip:** For the full list of type testing assertions see the documentation of . Running Tests If all is set, simply run command. Or better include a script in : License MIT © Jest Community