title: node js async/await request in function
body: <p>Hi I've some trouble with async/await in nodejs. I would use this into my factory in this way</p>
  
  <pre><code>//foo.js    
  
     var rp = require('request-promise');
  
     function Foo(options) {
          this.options = options;
      }
  
      function create() {
          return new Foo(login());
      }
  
      async function login() {
          const options = {
              method: `POST`
              ,json: true
              ,uri: `http://xxxxxx/login`
              ,body: {username: 'abcd', password: '1234'}
          };
          try {
              const response = await rp(options);
              return Promise.resolve(response)
          }
          catch (error) {
              return Promise.reject(error);
          }
      }
    module.export.create = create;
  </code></pre>
  
  <p>So I call create into my test and I'm expecting that return will be execute after login, but flow isn't this!!! </p>
  
  <pre><code>var Foo = require('foo');
  
  describe('using my utils into project', function () {
  
          it('using real case', function (done) {
  
              var foo = Foo.create();
              console.log(foo.options);
              done();
          });
  
      });
  </code></pre>
  
  <p>Test return me OK but in console I see <code>Promise { &lt;pending&gt; }</code> not real response after login process.
  Where is my error? Is correct working in this way?</p>