Skip to content

Please allow describe can do async with done/promise #2085

@Thaina

Description

@Thaina

In addition to --delay flag. Describe should also able to use done/promise flow to do async before using it

Such as, I want to do dynamic test for all user in database. I need to query user in database with async first, then each of user will emit their own test case in block

describe(function(done){
   query(function(users){
       users.forEach(function(user,i){
             it("Test : " + user.ID,function() {
                  if(!user.ID)
                        throw new Error("user " + i + has no ID);
             });
       });

       done();
   }); 
});

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