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

Consolidate tests with same describe in multiple files #196

Open
ProfessorTom opened this issue Jan 16, 2019 · 0 comments
Open

Consolidate tests with same describe in multiple files #196

ProfessorTom opened this issue Jan 16, 2019 · 0 comments

Comments

@ProfessorTom
Copy link

ProfessorTom commented Jan 16, 2019

There have been multiple issues filed around this idea already, namely #175, #149 and #163.

The problem is that if the describe is the same for two or more files–particularly if they are in the same directory–(so I probably need to do more testing) the last test to run is the test that gets recorded in the final output file whether or not the files are consolidated.

Example Time

let's say you have two files in the same directory that both have this line of code: describe('foo'...

If consolidateAll is set to true, only the tests that were in the last file ran will report for the suite foo.

If consolidateAll is set to false, there will only be one file generated, ignoring prefixes, suffixes and modifySuiteName.


The solution would be to keep track of the suites that have already been logged and if there are more tests that belong to that suite add them in the correct place in the xml output. This might be a bit tricky to figure out file names when consolidateAll is set to false and may require a bit more thought.

The use case I think I can solve is if people are trying to use describe to set up test suites across files by using the same text inside describe.

My proposal would be to add logic to do what I've described above which would be based on a flag called something like groupSameDescribesAcrossFilesIntoSingleTestSuite or something like that.

Comments, Criticisms and general discussion are encouraged.


NOTE: I'm filling a GitHub issue so that the world can work on this problem, but I have forked the repo with the thought of making the modification myself. When I actually sit down to work on the code, I'll add a comment to this issue. If someone beats me to the punch, please comment on this issue.

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

1 participant