Closed master117 closed 8 months ago
Hi @master117 !
Is every concerned files are well included within the typescript conmpilation (files, or include property in the root tsconfig.json
) ?.
ts-jest is using the root tsconfig.json
by default if no tsconfig
configuration property is provided.
After a quick investigation, it seems that "untested files" (and files that are not imported by any of your tests), are not processed by ts-jest, therefore, astTransformer are not applied.
So, if files that you specify within the --collectCoverageFrom options contains "import.meta" statements, they will not be transformed by ts-jest, but by a simplier typescript processor (?) provided by jest directly.
After a quick investigation, it seems that "untested files" (and files that are not imported by any of your tests), are not processed by ts-jest, therefore, astTransformer are not applied.
So, if files that you specify within the --collectCoverageFrom options contains "import.meta" statements, they will not be transformed by ts-jest, but by a simplier typescript processor (?) provided by jest directly.
Ah, good to know. Nothing you can do about that I guess. Thank you for the help!
On JEST 29.2.1
jest.config.ts:
Note that this is on untested files, which jest is rgabbing for coverage info via
jest --coverage --collectCoverageFrom='src/**/*.{ts,tsx}
No tested file currently contains meta.Please let me know if there is any other info you require.