@swc/jest
A Jest transform that compiles TypeScript and JSX with the Rust-based SWC compiler instead of Babel.
Repository Health
Technical Analysis
@swc/jest is Jest’s official-style integration for SWC, a Rust-based JavaScript/TypeScript compiler. Registered as a transform in jest.config.js, it replaces slower Babel- or ts-jest-based transforms with SWC’s native compilation, while still reading project .swcrc configuration, computing Jest-compatible cache keys, and supporting Jest’s code-coverage instrumentation hooks.
What You Get
- A drop-in Jest transform registered via the transform config key, replacing babel-jest or ts-jest
- Automatic .swcrc config loading with JSONC parsing, or inline transform options passed from jest.config.js
- Correct ESM vs CommonJS module output based on Jest’s supportsStaticESM flag per test file
- Coverage instrumentation support via automatic injection of the swc-plugin-coverage-instrument SWC plugin when Jest runs with —coverage
Common Use Cases
- Speeding up a large Jest test suite’s TypeScript/JSX compilation by swapping ts-jest or babel-jest for SWC
- Running Jest against ESM-authored source files with correct static-ESM output per Jest’s per-file module detection
- Collecting accurate code coverage from SWC-compiled tests via the custom coverage instrumentation option
- Sharing a single .swcrc configuration between a project’s build pipeline and its Jest test transform
Under The Hood
Architecture: index.ts exports createTransformer(), whose returned object implements Jest’s Transformer interface: process()/processAsync() call @swc/core’s transformSync/transform respectively, always overriding the module.type option per-file based on Jest’s supportsStaticESM flag, while getCacheKey() combines the SWC version, package version, and computed SWC options into a Jest-compatible cache key via @jest/create-cache-key-function; a separate buildSwcTransformOpts() helper merges explicit options with .swcrc (parsed via jsonc-parser to tolerate comments), defaults jsc.target from the running Node version, and forces jsc.transform.hidden.jest plus inline sourceMaps. Tech Stack: TypeScript compiled with tsc as part of a pnpm/Turborepo-style monorepo (swc-project/pkgs) alongside swc-loader and @swc/cli, with @swc/core and @jest/transform as its core dependency/peer surface and jsonc-parser for tolerant .swcrc parsing. Code Quality: The transformer is a single well-scoped 215-line index.ts with small pure helper functions (nodeTarget, insertInstrumentationOptions, set) and no classes; the monorepo runs eslint across packages, though this specific package’s own dedicated test suite is thin relative to its role as a widely-depended-on transform, relying more on downstream consumer test suites for real-world validation. API Design: Configuration is minimal, point Jest’s transform map at ‘@swc/jest’ with an optional inline options object, and it just works with existing .swcrc files, requiring no new mental model for teams already using SWC elsewhere in their toolchain.
Used by 47 apps in this directory
Langflow
AI Agents · AI Development
Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.
Logto
Authentication
Open-source auth infrastructure for SaaS and AI apps with OIDC, SAML, and RBAC
Mattermost
Collaboration · Devops · Team Chat
Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.
medusa
Ecommerce
The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.
Metabase
Analytics
The open-source BI platform that lets anyone ask questions and build dashboards without writing SQL — with an embedded analytics SDK and AI-powered query assistant included.
Metabase
Analytics
The open-source BI platform that lets anyone ask questions and build dashboards without writing SQL — with an embedded analytics SDK and AI-powered query assistant included.
Novu
Developer Tools
Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.
Onyx
AI Agents · AI Assistants · Knowledge Management
Self-hostable AI platform with agentic RAG, 50+ connectors, deep research, code execution, and support for every major LLM provider.
OpenPanel
Devops · Hosting Control Panel
Docker-powered web hosting control panel that gives every user a fully isolated environment with dedicated web server, database, and networking — VPS-grade security on shared hardware.