New issue
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
Support for TypeScript 3.7.2 #1299
Comments
This doesn't look like a typescript version issue. The import format has been the same for a while. Is the rest of the config correct? |
Yes, it broke for me after upgrading the typescript package. tsconfig.json: {
"compilerOptions": {
/* Redirect output structure to the directory. */
"outDir": "dist",
/* Specify ECMAScript target version */
"target": "esnext",
/* Specify module code generation */
"module": "commonjs",
/* Determine how modules get resolved */
"moduleResolution": "node",
/* Skip type checking of all declaration files (*.d.ts). */
"skipLibCheck": true,
/* Emit design-type metadata for decorated declarations in source. */
"emitDecoratorMetadata": true,
/* Enables experimental support for ES decorators. */
"experimentalDecorators": true,
/* Emit a single file with source maps instead of having a separate file. */
"inlineSourceMap": true,
/* Emit the source alongside the sourcemaps within a single file. */
"inlineSources": true,
/* Enable all strict type checking options. */
"strict": true,
},
"include": [
"src"
]
} jest.config.js module.exports = {
/* A list of paths to directories that Jest should use to search for files in */
roots: ['src'],
/* The test environment that will be used for testing */
testEnvironment: 'node',
/* A map from regular expressions to paths to transformers */
transform: { '^.+\\.tsx?$': 'ts-jest' },
/* Allows the use of a custom global setup module which exports an async function that is triggered once before all test suites */
// globalSetup: './src/lib/jest/global-setup.ts',
/* Allows the use of a custom global teardown module which exports an async function that is triggered once after all test suites */
// globalTeardown: './src/lib/jest/global-teardown.ts',
/* A list of paths to modules that run some code to configure or set up the testing environment. */
// setupFiles: ['core-js/features/array/flat', './src/lib/jest/setup.ts'],
}; |
I think I have this same issue but with Typescript version
|
@kulshekhar do you have any idea what may cause this? |
@ChrisLahaye not really. I tried it out and it worked fine for me. I checked the package-lock.json for good measure and it has the 3.7.2 version of typescript (all tests are passing with 3.7.2) |
sorry, it was a quick test that I carried out in a temp directory and
deleted it after.
Side note: ts-jest has tests which you can take a look at in case you're
still stuck.
…On Mon, Dec 2, 2019 at 1:43 AM Chris Lahaye ***@***.***> wrote:
@kulshekhar <https://github.com/kulshekhar> can you post a gist of your
code
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1299?email_source=notifications&email_token=ACSH7UHKRM3JEOALKUNPZBDQWQLIJA5CNFSM4JRH7ANKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFRUHKI#issuecomment-560153513>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACSH7UDI7HVXKMDS4PNUKGLQWQLIJANCNFSM4JRH7ANA>
.
|
Related to #1288 |
For me the problem was that I was using |
Yes, "target": "ES2019" resolves this issue! |
@squalsoft , Hi, I've always the problem, can you share your tsconfig, please ? and jest.config ? |
@frck006
jest.config
|
ESNEXT will not tranform optional chaining which is not supported by node yet ref kulshekhar/ts-jest#1299 (comment)
I'd just like to add |
#1678 will add a warning message for this scenario |
Hello!
ts-jest currently does not work with TypeScript 3.7.2. Import statements are not transformed in the transformed code of imports in test files.
The text was updated successfully, but these errors were encountered: