Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Use full name of hierarchy for test reporting #63

Closed
maniax89 opened this issue Feb 28, 2018 · 3 comments
Closed

Use full name of hierarchy for test reporting #63

maniax89 opened this issue Feb 28, 2018 · 3 comments

Comments

@maniax89
Copy link

On test reporting with mocha, the line at https://github.com/forcedotcom/LightningTestingService/blob/master/lightning-component-tests/test/default/staticresources/lts_testutil.resource#L196

indicates that we only get the immediate parent's title for the description.

Is there either way to

  1. specify the filename or
  2. specify the entire parent hierarchy for the fullname

if i have a test that looks like

describe('MyComponent', () => {
  describe('when I do X', () => {
     it('should do Y', () => {
     });
     describe('then I do A', () => {
        it('should do B', () => {
        });
     });
  });
});

I won't know what file the output is coming from when the test result full name is:

then I do A : should do B

the goal here is to set up a file for each component to test its behaviors independently of the other components rather than having one giant file (and hopefully nested behaviors for reusability of events)

@esalman-sfdc
Copy link
Contributor

To confirm, you'd like 'FullName' to be generated by iteratively walking up the parent chain instead of simply appending parent.title with test.title. I think the original reasoning was to keep the name short to avoid any formatting issues, but I can understand how missing that hierarchical information can be confusing.

By the way, do you use the unmanaged package or the code from source in your setup? Basically wondering if you are up for taking a stab at the change and possibly submitting a pull request :)

@maniax89
Copy link
Author

I think if you want to keep the lines short, having the ability to specify a suiteName or fileName might be easier if you want to keep it on one line. Going down the hierarchical route probably requires a lot more thought into the reporting (do we indent per parent?) I think most test reporting frameworks maintain that hierarchy but I wouldn't want to change it to that unless others agreed.

Currently our workflow involves installing the unmanaged package, but we could easily switch to pointing at this repo using a git submodule and deploying that way which would make it easier for submitting a PR.

As far as submitting a PR, I guess it depends on if I could get to it in a week or so. I'll see if this issue gains any traction from other users during that time and maybe we could decide if the suiteName would work better or maintaining the hierarchy would be better (similar to what the browser displays)

@esalman-sfdc
Copy link
Contributor

Change made. Next package release will have the changes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants