ts-jest-mock-import-meta
A TypeScript AST transformer for ts-jest to mock import.meta expressions.
Pricing
Free tier
Flat rate
Adoption
→StableLicense
Open Source
Data freshness
Aging · Jun 8, 2026Overview
What is ts-jest-mock-import-meta?
This tool provides a simple Typescript AST transformer that mocks import.meta expressions in Jest tests, making it easier to test code using dynamic imports and other meta properties.
Key differentiator
“The only tool specifically designed to mock import.meta expressions in ts-jest, providing a seamless way to test dynamic imports and meta properties without manual intervention.”
Capability profile
Capability Radar
Honest assessment
Strengths & Weaknesses
↑ Strengths
↓ Weaknesses
The tool's GitHub repository lacks comprehensive guides or tutorials, making it difficult for new users to understand its full capabilities.
ts-jest-mock-import-meta is highly specialized in mocking import.meta expressions and does not address other common testing challenges, which may require additional tools or custom solutions.
As a transformer tool, it heavily relies on the AST of TypeScript. With frequent updates to TypeScript, there is a risk that ts-jest-mock-import-meta may not be immediately compatible or require significant updates.
The tool's GitHub repository has limited activity, with few contributors and infrequent updates, which could lead to slower resolution of issues or feature requests.
Fit analysis
Who is it for?
✓ Best for
TypeScript developers who need to test code using import.meta expressions.
Projects requiring precise control over the mocking of dynamic imports and meta properties in Jest tests.
✕ Not a fit for
Developers working with languages other than TypeScript.
Projects that do not use Jest for testing.
Cost structure
Pricing
Free Tier
Available
Open source — free to use
Starts at
$0
Model
Flat rate
Enterprise
None
Performance benchmarks
How Fast Is It?
Ecosystem
Relationships
Works well with
Integrations
Next step
Get Started with ts-jest-mock-import-meta
Step-by-step setup guide with code examples and common gotchas.