I'd like to test a rest api with gagarin.
I figured I could use the 'http' module of node.js.
No big deal : require('http'); at begining of test files.
But then, I have to return a promise in my test, like
it("....", function() {
return client
.execute(function() {
return computedEnpoint();
}).then(function(url) {
return new Promise(function(reject, resolve){
http.get(url, function(res){
resolve("How cool?");
});
});
});
});
It fails with Promise is undefined.
I can't find a way to grab promise from meteor, or with a require.
I'd like to test a rest api with gagarin.
I figured I could use the 'http' module of node.js.
No big deal :
require('http');at begining of test files.But then, I have to return a promise in my test, like
It fails with
Promise is undefined.I can't find a way to grab promise from meteor, or with a require.