WebStorm, An async function or method in ES5/ES3 requires the 'Promise' constructor

前端 未结 4 1790
走了就别回头了
走了就别回头了 2021-01-17 12:39

I try to write tests in typescript (ES6) using WebStorm IDE. E.g.:

// Imports...

describe(\'Message\', () => {
    const server = express();
    serv         


        
4条回答
  •  执念已碎
    2021-01-17 12:41

    Solution without editing the project sources

    I had this problem with IntelliJ and resolved by changing my IDE settings:

    Settings -> Language & Frameworks -> TypeScript

    then in the "Options" field add:

    --lib es2015
    

提交回复
热议问题