Skip to content

how to access Promise in test code ? #180

Description

@welelay

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions