Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 511 Bytes

README.md

File metadata and controls

18 lines (13 loc) · 511 Bytes

Can't use top-level await with ts-jest

npm run tla shows that top-level await works with ts-node.

npm test shows that the await line in add.test.js causes error TS1378:

Top-level 'await' expressions are only allowed when the 'module' option is set to 'esnext' or 'system', and the 'target' option is set to 'es2017' or higher.

However, tsconfig.json already contains these settings:

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext"
  }
}