We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import.meta
Thanks for the package, it performs well and is simple to set up. ❤️
I'm using it as a Jest transformer and trying to test a function written in Typescript to read a package JSON file:
import { createRequire } from 'module' import { resolve } from 'path' export const requirePackage = (path: string) => createRequire(import.meta.url)(resolve(path, 'package.json'))
I get an error from import.meta.url being undefined.
import.meta.url
Possibly related issue in TS-Jest? kulshekhar/ts-jest#1174
The text was updated successfully, but these errors were encountered:
My configs...
tsconfig.json
{ "compilerOptions": { "baseUrl": "src", "module": "esnext", "moduleResolution": "Node", "lib": ["ESNext"], "allowJs": true, "checkJs": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "isolatedModules": true, "skipLibCheck": true, "strict": true } }
jest.config.mjs
export default { testEnvironment: 'node', extensionsToTreatAsEsm: ['.ts'], moduleFileExtensions: [ 'ts', 'tsx', 'mjs', 'js', 'jsx', 'json', 'node' ], transformIgnorePatterns: ['/node_modules/.*\\.js$'], transform: { '\\.(ts|tsx)?$': 'esbuild-runner/jest', } }
Sorry, something went wrong.
any updates?
No branches or pull requests
Thanks for the package, it performs well and is simple to set up. ❤️
I'm using it as a Jest transformer and trying to test a function written in Typescript to read a package JSON file:
I get an error from
import.meta.url
being undefined.Possibly related issue in TS-Jest? kulshekhar/ts-jest#1174
The text was updated successfully, but these errors were encountered: