deno_std
deno_std copied to clipboard
fix(testing/bdd): fix cases where `only` keyword skips tests that should run
Fixes #2979
There seems to be unexpected behavior when using test suites with describe.only
.
The file only_test.ts
will not be committed. I'm using it to demonstrate which tests I believe should be running, but are not. There are still some edge cases which don't seem to be working properly, and I have documented.
If someone could please verify that the cases I laid out in only_test.ts
are correctly marked as "Should run", I'll start writing tests for those cases.
The expectations in only_test.ts looks good to me, but let's not consider flat test grouping nested inside other suites like the below:
describe("outer 2.2", () => {
describe(onlyTests, "inner 2.2.1", () => {
/**
* Should run
* Fixed
*/
it("it 2.2.1", () => {
assertEquals(0, 0);
});
});
});
I don't think we support this situation
The expectations in only_test.ts looks good to me, but let's not consider flat test grouping nested inside other suites like the below:
The specific one you mentioned is actually fixed, although I can remove it if you prefer. There are three cases in the file marked "Bugged." I will make notes on them.
Added snapshot test case to check the output of the given example.
Now the below existing test cases are failing:
global ... describe ... only ... signature 1 ... all options => ./testing/bdd_test.ts:954:17
global ... describe ... only ... signature 3 ... all options => ./testing/bdd_test.ts:994:17
global ... describe ... only ... signature 4 => ./testing/bdd_test.ts:1010:15
global ... describe ... only ... signature 5 => ./testing/bdd_test.ts:1022:15
global ... describe ... only ... signature 6 ... minimum options => ./testing/bdd_test.ts:1035:17
global ... describe ... only ... signature 6 ... all options => ./testing/bdd_test.ts:1047:17
global ... describe ... only ... signature 7 ... minimum options => ./testing/bdd_test.ts:1063:17
global ... describe ... only ... signature 7 ... all options => ./testing/bdd_test.ts:1075:17
global ... describe ... only ... signature 8 ... minimum options => ./testing/bdd_test.ts:1092:17
global ... describe ... only ... signature 8 ... all options => ./testing/bdd_test.ts:1104:17
@pting-me Do you have any idea what is going wrong?
Gentle ping, @pting-me.
Closing as it is stale now. Let's revisit when someone start complaining about this