-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: only and skip support #55
Conversation
mod.ts
Outdated
// FIXME(edward) Any test suite within a plan will a ctually hit this block, if there was a test suite before it. It should not hit this block | ||
if (this.passed_in_test_plan && this.passed_in_test_suite) { // is a test case being skipped | ||
this.plan.suites[this.passed_in_test_suite].cases!.push({ | ||
name, | ||
new_name: this.formatTestCaseName(name), | ||
testFn: cb, | ||
only: true | ||
}); | ||
} else if (this.passed_in_test_plan) { // is a test suite being skipped | ||
this.passed_in_test_suite = name; | ||
this.plan.suites![name] = {cases: [], only: true}; | ||
cb(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to figure this out
Developments so far:
What's left:
|
Decided to add skip support as well, because the only way only or skip will land, is if we ditch current output format, so may as well do it in one pr |
can we rework this PR to be pointed to v2? or should we trash it and start over with a new branch, but taking the logic from this branch as a starting point? |
Oh we can trash this PR, I was only keeping it open as a reference really until we landed your pr, if this PR is no use to you then feel free to close it and delete the branch 👍 |
i think it's still useful. we can keep it open as a reference for .only(). i like the edge cases so let's keep it open for now |
Alright |
Do we need only and skip properties for every test interface? It seems like it just overcomplicates things. For example, what happens if both only and skip are set to true? |
Hey, yes because it means any test suite or case can be skipped, and i believe i added checks for if both are used but i can't remember, this PR was from a while ago :P Tbh, we're only keeping this PR up for reference purposes for the rhum v2 PR, none of this code will end up in master and when rhum v2 is in master, this pr will be closed and the code lost forever 😢 |
I know. I just realized that this getting this to work is probably not possible if we keep using deno.std/testing as a base, unless we find some way to change the message format for deno.std/testing. The only way I can see to get this work is just to write our own base for testing instead of working off of deno.std/testing. |
So basically we would have to write our own "deno:cli/rt/40_testing.js". |
it might be that we don't need this feature now that i think about it. i say this because rhum v2 CLI has the --filter-test-case and --filter-test-suite options |
I think those options achieve the same functionality as skip, but I'm not sure those options achieve the same functionality as only. I'm pretty sure ebebbington's code would have worked if Deno's testing api had more customizable format options. |
My pr was going to use a different test definition so we could use skip and only, but this meant the output would have changed in the shell for users Where as now with Rhum v2, we have good output and can still ignore and only tests |
For reference, this PR is only open to aid in eric's v2 PR, should any of the work i have done come in handy. Once the v2 pr is merged, this will be closed without merging |
not doing this anymore. v2 will be a test double framework |
Fixes issue 5
WIP
Developments so far
What's left
Different types of output