superAgent support await / async

superAgent support await / async

From superAgent 2.0 version, it adapt Promise, so we can use await, async in current request.

SuperAgent's request is a "thenable" object that's compatible with JavaScript promises and async/await syntax.  

Also, superTest has superAgent as onne of dependencies. Now superTest upgrade dependencies, we can directly use superAgent 2.0 await async feature in test case.

code example

await / async style

let response = await request(app)  
                  .send({"email": "[email protected]", "password": "123"});

old style

  .send({"email": "[email protected]", "password": "123"})
  .end(function (err, res) {


Web developer, focus on website fullstack, special JavaScript, and love sharing developing experience and communicate with developers.