Skip to content
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

Custom formatters can only be loaded by relative path #1412

Closed
dawn-minion opened this issue Aug 26, 2020 · 6 comments · Fixed by #1413
Closed

Custom formatters can only be loaded by relative path #1412

dawn-minion opened this issue Aug 26, 2020 · 6 comments · Fixed by #1413
Assignees

Comments

@dawn-minion
Copy link
Member

In builder.ts#L107, we load custom formatters as relative to the current working directory. Unfortunately this means that if the package is not relative to the project we can't load it. In my particular case I'm trying to use Yarn PNP with the cucumber-pretty formatter, and with PNP the package will no longer be relative to the project, but can be included by name (It lives in the user's cache folder instead).

We could try loading by relative path first, and if that fails we could then try by name, which should cover both cases.

@charlierudolph
Copy link
Member

Can you give a more detailed example of how to reproduce your issue? (ie exact steps of what you are trying to do)

@charlierudolph
Copy link
Member

Hmm, okay so PNP definitely changes a lot of things here. I'd be okay with the following:

  • when loading a node module just use the name
  • to load via local paths, you are required to have a leading . (similar to how general require works)

@dawn-minion
Copy link
Member Author

Would the second requirement break existing users though? In the current setup I have (before the PNP switch) it was always --format=node_modules/cucumber-pretty since that just worked. Not that it's a big deal, but thought I'd ask

@bankimzededa
Copy link

Hi,

Is there any way I can disable all logs from cucumber, I need to show only details regarding failed test. Right now cucumber is printing all tests details including passed and failed.

Thanks
Bankim

@charlierudolph
Copy link
Member

charlierudolph commented Oct 14, 2020

@bankimzededa please use the support channels listed on the readme or review the CLI format documentation. I'd like to keep each issue as a targeted discussion.

@dawn-minion yep that would be a breaking change, though I think a pretty minor one since its super easy for someone to fix.

@dawn-minion
Copy link
Member Author

Sounds good then, will update the PR to switch based on a leading ..

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 a pull request may close this issue.

3 participants