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

Test ordering #15

Closed
cappelaere opened this issue Jul 20, 2018 · 4 comments
Closed

Test ordering #15

cappelaere opened this issue Jul 20, 2018 · 4 comments

Comments

@cappelaere
Copy link

Is there a way we could preserve the order of the tests?
This would be a great feature for an acceptance test.
I tried to have the files in alphabetical/numeric order but it did not help.
Thanks.

@bencompton
Copy link
Owner

Jest is running your tests, so there isn't really anything I'm aware of that jest-cucumber can do to control the execution order. I see there is actually an open issue in the Jest repo about this very topic.

Is your motivation primarily aesthetic, or do your scenarios depend on a particular execution order? For the latter case, I'm sure there are perfectly valid exceptions, but I generally follow the rule of having no shared state between tests so they can all execute independently and more reliably.

@cappelaere
Copy link
Author

We are testing a very complex processing chain that runs on AWS. Each 'scenario' takes a long time to complete. If we fail on the first workflow, there is no point in testing the rest of the system. Each feature focusses on the different aspects or flows of the processing chain.

@cappelaere
Copy link
Author

I came up with a solution... get jest to ignore the steps.js files in the steps directory but use the index.js in that directory.
Then in steps/index.js:
const step1 = require('./1.steps');
const step2 = require('./2.steps');
const step3 = require('./3.steps');
const step4 = require('./4.steps');
const step5 = require('./5.steps');
const step6 = require('./6.steps');
const step7 = require('./7.steps');

@bencompton
Copy link
Owner

That's interesting, I can certainly understand your challenge there. Glad you were able to find a solution that works for you.

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

2 participants