title: WebStorm, An async function or method in ES5/ES3 requires the 'Promise' constructor
body: <p>I try to write tests in typescript (ES6) using WebStorm IDE. E.g.:    </p>
  
  <pre><code>// Imports...
  
  describe('Message', () =&gt; {
      const server = express();
      server.use(bodyParser.json());
  
      const messageService = { findAll: () =&gt; ['test'] };
  
      beforeAll(async () =&gt; {
          const module = await Test.createTestingModule({
              modules: [MessageModule],
          })...
      });
  
      // Tests...
  });
  </code></pre>
  
  <p>However WebStorm IDE shows following error at <code>async () =&gt;</code> </p>
  
  <blockquote>
    <p>TS2705: An async function or method in ES5/ES3 requires the Promise
    constructor. Make sure you have a declaration for the Promise
    constructor or include ES2015 in your --lib option.</p>
  </blockquote>
  
  <p>My <code>tsconfig.json</code>:</p>
  
  <pre><code>{
    "compilerOptions": {
      "module": "commonjs",
      "declaration": false,
      "noImplicitAny": false,
      "removeComments": true,
      "noLib": false,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "target": "es6",
      "sourceMap": true,
      "allowJs": true,
      "outDir": "./dist"
    },
    "include": [
      "src/**/*"
    ],
    "exclude": [
      "node_modules",
      "**/*.spec.ts"
    ]
  }
  </code></pre>
  
  <p>I read <a href="https://stackoverflow.com/questions/43555378/ts-an-async-function-or-method-in-es5-es3-requires-the-promise-constructor">ts An async function or method in ES5/ES3 requires the &#39;Promise&#39; constructor</a> and tried adding </p>
  
  <pre><code>"lib": [ "es2015" ]
  </code></pre>
  
  <p>however it does not have any effect. Any ideas what's wrong?</p>