Ts-jest: Doesn't accept ?? with Typescript 3.8

Created on 21 Feb 2020  路  3Comments  路  Source: kulshekhar/ts-jest

Issue :

Tests which encouter code with ?? whilst using typescript 3.8 fails, however it does not fail with typescript 3.7

    Details:

    src/lib/Mail.ts:78
                            Data: `From: ${fromName ?? "Default"}<${Source}>
                                                     ^

    SyntaxError: Unexpected token '?'

    >  9 | export * from "./Mail";
         | ^
      10 | export * from "./Notification";

      at Runtime._execModule (node_modules/jest-runtime/build/index.js:988:58)
      at Object.<anonymous> (src/lib/index.ts:9:1)

Expected behavior :

Should accept ?? which is supported by TS 3.8

Debug log:


log file content

# content of ts-jest.log :

Minimal repo :

Most helpful comment

@seand52 I think it was my tsconfig target being es2020, had to drop down to es2019. Something changed how ?? Was handled by ts and node 12/13 don't natively support it yet so I had to drop down.

All 3 comments

nevermind, unrelated to this package

I've encountered the same problem. What was the issue?

@seand52 I think it was my tsconfig target being es2020, had to drop down to es2019. Something changed how ?? Was handled by ts and node 12/13 don't natively support it yet so I had to drop down.

Was this page helpful?
0 / 5 - 0 ratings