Last active
September 6, 2016 13:55
-
-
Save saml/38264476e15fc115dd8e2e0913fccc31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var supertest = require('supertest-as-promised'); | |
var express = require('express'); | |
const app = express(); | |
function fetch() { | |
return supertest(app).get('/') | |
.send(); | |
} | |
Promise.resolve(1) | |
.then((x) => { | |
var res = fetch(); | |
console.log('First', typeof res.expect); // this is Function as expected. | |
return res; | |
}) | |
.then((res) => { | |
console.log('Second', typeof res.expect); // why is this undefined? | |
return res; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment