Skip to content

Conversation

@KuznetsovRoman
Copy link
Member

@KuznetsovRoman KuznetsovRoman commented Mar 27, 2025

Example: https://nda.ya.ru/t/JsP7_JVY7D85nm

Status: issues with parent and child nodes. WIP

id: 's1 s2',
name: 's1 s2',
parentId: null,
root: true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Root suite

id: 's1 s2',
name: 's2',
parentId: 's1',
root: false,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now its non-root suite with "s1" being parent suite

const suite: TreeSuite = {id, parentId, name, suitePath, root: isRoot};

this._addSuite(suite);
} else if (!isRoot && suites.byId[id].root) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about case

describe("Some", function() {
    describe("Nesting suite", function() {
        it("it");
    });
});

describe("Some", function() {
    describe("Nesting", function() {
        it("suite it");
    });
});

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[13:27:36 +0300] Error: Tests with the same title 'Some Nesting suite it' in file 'testplane-tests/example.testplane.ts' can't be used
    at /testing-project/node_modules/testplane/src/test-reader/test-parser.ts:191:23

Copy link
Member Author

@KuznetsovRoman KuznetsovRoman Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed condition to "if current suite has more items in suitePath"

@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-488.suite_nesting branch 2 times, most recently from f60659c to 0d71e21 Compare April 10, 2025 22:15
@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-488.suite_nesting branch from 0d71e21 to 306578b Compare April 10, 2025 22:21
const suite: TreeSuite = {id, parentId, name, suitePath, root: isRoot};

this._addSuite(suite);
} else if (suitePath.length > suites.byId[id].suitePath.length) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can do it in function with a name that explains what's going on in it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment would be more clear

@KuznetsovRoman KuznetsovRoman marked this pull request as draft April 18, 2025 11:43
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

Successfully merging this pull request may close these issues.

4 participants