Skip to content

programmatically call AVA tests #830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ORESoftware opened this issue May 13, 2016 · 3 comments
Closed

programmatically call AVA tests #830

ORESoftware opened this issue May 13, 2016 · 3 comments

Comments

@ORESoftware
Copy link

ORESoftware commented May 13, 2016

In the case that a developer wants to pass data to a test file programmatically (not at the command line)

with Mocha, seemingly the only way to do this would be:

function wrapTheMochaSuiteWithThisFn(data){


  describe('root suite', function(){

      describe('child suite', function(){

       data.forEach( item => {
             it('stubbed test case');
        });

     });

  });

}

if(require.main === module){
   wrapTheMochaSuiteWithThisFn([]);  // if test file is executing directly, run it
}

module.exports = wrapTheMochaSuiteWithThisFn;

will we have to do the same thing with AVA if we want to pass data / inject data into tests?

@sindresorhus
Copy link
Member

See: #695

@jamestalmage
Copy link
Contributor

Currently you have to do it the same way you do it in mocha. We are discussing an alternate solution in #695

@ORESoftware
Copy link
Author

ah thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants