Skip to content

🚀 Feature: Allow async function in describe (block) #2116

@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();
   }); 
});

ps. This thread is copied from #2085 . It was ruin by a someone and was locked. And I need to make it reopen to ask for something

@boneskull I know that it would not be implemented immediately. That's what software development process is

What I would like you to do is consider you will never do it. Or will be doing it in which version. So I would consider move to another tool or make it by myself

ps2 @boneskull if you just not hurry lock that thread I would not need to waste another thread like this

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions