Skip to content
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

Dynamically generating tests #10

Open
sairamnutheti opened this issue Mar 21, 2018 · 3 comments
Open

Dynamically generating tests #10

sairamnutheti opened this issue Mar 21, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@sairamnutheti
Copy link

sairamnutheti commented Mar 21, 2018

We have a situation, where we need to perform an asynchronous operation to fetch data and generate tests for each of the data. Any thoughts?

const tests = asyncGetDataFromDB();
describe('generate tests dynamically', function() {
  tests.forEach(function(test) {
    it(test.desc, async function() {
      // make assertions
    });
  });
});
@sairamnutheti sairamnutheti changed the title Dynamically generate tests Dynamically generating tests Mar 21, 2018
@grawk
Copy link
Member

grawk commented Mar 21, 2018

In mochajs generally, it is possible to utilize the delay / run technique mentioned at the bottom of this issue discussion:
mochajs/mocha#1483 (comment)

I can imagine how it's possible to enable this technique in nemo.

Another possibility would be to dynamically generate suite file(s) and point the mocha config towards the file(s) prior to running.

The second alternative could be accomplished more quickly due to it having fewer moving parts within nemo.

@grawk grawk added the enhancement New feature or request label Mar 21, 2018
@sairamnutheti
Copy link
Author

Thanks @grawk. If I go with the first approach will that need any changes in nemo runner? or will it work without any changes in nemo module?

@grawk
Copy link
Member

grawk commented Mar 21, 2018

Changes would be required for both approaches I think.

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

No branches or pull requests

2 participants