Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Getting ts-jest to work with testing files that use the .env mjs files - Theo's Typesafe Cult
TTC
Theo's Typesafe Cult
•
4y ago
•
9 replies
Web Dev Cody
Getting ts-jest to work with testing files that use the .env mjs files
I
'm trying to write a unit test to verify some code
. This code uses the t3
env
env
variable which is setup in these
.mjs
.mjs
files
. When I run jest it keeps failing to import
from "./schema.mjs"
from "./schema.mjs"
. Does anyone have an example repo which has test working fine in this scenario
?
Theo's Typesafe Cult
Join
26,564
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Environment variables validation not working with Jest (env.mjs)
TTC
Theo's Typesafe Cult / questions
3y ago
env.mjs - Use as const
TTC
Theo's Typesafe Cult / questions
3y ago
Importing mjs files in "non project/standalone" TS files
TTC
Theo's Typesafe Cult / questions
3y ago