8000 Wrong test hierarchy with conditional tests · Issue #6 · andresdominguez/ddescriber · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Wrong test hierarchy with conditional tests #6
Open
@AlexTalis

Description

@AlexTalis

I have some tests that are added conditionally based on environment. This produces incorrect test hierarchy. Here's a sample test file:

describe('Main Suite', function () {
    it('Test 1 should be child of Main Suite', function () {});

    // Conditions for including or excluding some suites or specs.
    var condition1 = false;
    var condition2 = false;
    var condition3 = false;
    if (condition1) {
        it('Test 2 should be child of Main Suite, not child of Test1.', function () {});

        if (condition2) {
            if (condition3) {
                describe('Suite 2 should be child of Main Suite, not child of Test1.', function () {});
            }
        }
    }
});

This is the resulting test hierarchy:

image

This is the hierarchy I would expect to see:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0