A Jest transformer with source map support that lets you use Jest to test projects written in TypeScript. (by kulshekhar)

Ts-jest Alternatives

Similar projects and alternatives to ts-jest

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better ts-jest alternative or higher similarity.

Suggest an alternative to ts-jest

ts-jest reviews and mentions

Posts with mentions or reviews of ts-jest. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-05-18.
  • Improve your Testing with Custom Matchers in Jest
    2 projects | dev.to | 18 May 2022
    I want to save you from manually copying the snippets one by one, so here is a Gist with the complete test file. This can be easily executed with Jest (or ts-jest for TypeScript).
  • Testing Mongoose with Ts-Jest
    3 projects | dev.to | 20 Apr 2022
  • A complete guide to full-stack live reload
    9 projects | dev.to | 16 Mar 2022
    See the Jest configuration docs to learn more about Jest configuration. ts-jest also has good documentation.
  • Setup Jest to React Typescript Vite project, also SWC (part 1)
    13 projects | dev.to | 14 Mar 2022
    Using @swc/jest to compile code to CommonJS is much faster than babel-jest, ts-jest which have long cold starts when executing tests in a large project.
  • Component Testing in Svelte
    6 projects | dev.to | 19 Feb 2022
    ts-jest: A transformer for handling TypeScript files.
  • Running Jest for Typescript CLI - unexpected token at import
    1 project | reddit.com/r/typescript | 22 Jan 2022
    Anyway, I ran into this exact error this morning setting up Jest for a TS script. I fixed it by just following the getting started instructions for Jest as well as ts-jest.
  • The Ultimate Guide to TypeScript Monorepos
    17 projects | dev.to | 26 Nov 2021
    Thankfully using TypeScript and TypeScript project references makes the intricate problem of using Jest easier since we can make use of the excellent ts-jest Jest transformer. All we need to do it point ts-jest to the respective tsconfig.json file for each package (see example jest.config.js). Since we have configured TypeScript to be composite and incremental, we do not need to recompile TypeScript for dependencies of a package we want to test, which significantly reduces the runtime for unit tests. ts-jest will also ensure that any error message will reference the line numbers in the source TypeScript files.
  • Testing Svelte components with Jest and Vite
    8 projects | dev.to | 18 Nov 2021
    We need to configure Jest to transform our files. We must explicitly set our test environment to jsdom, which we are using through Jest. Since v27 Jest's default test environment is node. I will put the configuration in a specific Jest configuration file called jest.config.json in the project root folder. If you create a configuration file called jest.config.js, Vite will complain as it expects only ESM JavaScript by default. Vite will recommend that you rename it to a ".cjs" file if you want to do it that way. You can look at the different ways to configure Jest if you are unsure about the file conventions. If you're using TypeScript, you need to configure svelte-preprocess and ts-jest also, see the svelte-jester docs for how to do that.
  • Lab 8: TESTING !!!!
    1 project | dev.to | 17 Nov 2021
    To be able to use Jest proficiently with Typescript, we will need help from ts-jest so as to use the advantage of a type-safe language
  • What does it take to support Node.js ESM?
    9 projects | dev.to | 12 Aug 2021
    There are workarounds, but nothing actually works in 100% of the possible use-cases (see for example, ts-jest issue), and for that reason, we recommend tooling that enables this type of building without needing any workaround, usually using Rollup and/or esbuild.
  • Creating vite vue ts template: Setup Jest
    2 projects | dev.to | 31 Jul 2021
    We are using typescript in our project. To properly setup jest we would need to install ts-jest package as well.
  • Help me understand the state of TS mocking ecosystem
    2 projects | reddit.com/r/typescript | 15 May 2021
    My team uses ts-jest and for mocking complex objects factoree is really awesome.
  • TS and ts-jest meet “type”: “module”
    3 projects | dev.to | 11 May 2021
    Unfortunately, ts-jest does not support this API now: ts-jest/issues/1174. Therefore, we have to keep __dirname/__filename in TS sources and perform the replacement in the bundles. Behold the glory of regex inside the regex replacer with escaped backslash escapes:
"build:fix-module-dirname": "find target/es5 ./target/es6 -type f -name '*.js' -print0 | xargs -0 perl -pi -e \"s/__dirname/\\/file:\\\\\\\\\\\\/\\\\\\\\\\\\/(.+)\\\\\\\\\\\\/\\[^\\/\\]\\/.exec(import.meta.url)[1]/g\"". This piece of code just replaces all __dirname occurrences with /file:\/\/(.+)\/[^/]/.exec(import.meta.url)[1].
  • How do I unit test my *browser only* typescript project with modules using jest?
    3 projects | reddit.com/r/typescript | 10 Apr 2021
    I've spent the last 6 hours googling for a solution. I found an issue on ts-jest Github, but the response is basically the maintainers saying "not our problem". They link to an older Feature Request issue, that is hanging open since last september with no answer either.


Basic ts-jest repo stats
7 days ago

kulshekhar/ts-jest is an open source project licensed under MIT License which is an OSI approved license.

Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
SonarLint is a free and open source IDE extension that identifies and catches bugs and vulnerabilities as you code, directly in the IDE. Install from your favorite IDE marketplace today.
Find remote TypeScript jobs at our new job board 99remotejobs.com. There are 2 new remote jobs listed recently.
Are you hiring? Post a new remote job listing for free.