-
Notifications
You must be signed in to change notification settings - Fork 53
fix: transform root suite to non-root when non-root id matches root id #644
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
base: master
Are you sure you want to change the base?
Conversation
id: 's1 s2', | ||
name: 's1 s2', | ||
parentId: null, | ||
root: true, |
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.
Root suite
id: 's1 s2', | ||
name: 's2', | ||
parentId: 's1', | ||
root: false, |
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.
Now its non-root suite with "s1" being parent suite
lib/tests-tree-builder/base.ts
Outdated
@@ -160,6 +160,14 @@ export class BaseTestsTreeBuilder { | |||
const suite: TreeSuite = {id, parentId, name, suitePath, root: isRoot}; | |||
|
|||
this._addSuite(suite); | |||
} else if (!isRoot && suites.byId[id].root) { |
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.
what about case
describe("Some", function() {
describe("Nesting suite", function() {
it("it");
});
});
describe("Some", function() {
describe("Nesting", function() {
it("suite it");
});
});
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.
[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
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.
Changed condition to "if current suite has more items in suitePath"
f60659c
to
0d71e21
Compare
0d71e21
to
306578b
Compare
@@ -160,6 +160,17 @@ export class BaseTestsTreeBuilder { | |||
const suite: TreeSuite = {id, parentId, name, suitePath, root: isRoot}; | |||
|
|||
this._addSuite(suite); | |||
} else if (suitePath.length > suites.byId[id].suitePath.length) { |
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.
Maybe we can do it in function with a name that explains what's going on in it?
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.
A comment would be more clear
Example: https://nda.ya.ru/t/JsP7_JVY7D85nm
Status: issues with parent and child nodes. WIP