question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide an option to use dasherized test names

See original GitHub issue

When tests are generated, there name is humanized to make it more readable by humans. This process removes the dashes from the base strings, meaning some-component’s test name will be some component.

I recently had a problem where I couldn’t run test for one of my components with ember test --filter="some-component". To make it more confusing, jshint tests ran well for the expected files, but the test itself didn’t run. @Turbo87 helped me figure out it was because the test name was some component, therefore not matching some-component.

Considering the test’s name is humanized, it was counter intuitive to think that it may be used in resolution.

Could an option be added to the generator, in order to allow for the string to stay dasherized? With that option, a test generated for some-name/space/some-component would actually contain some-name/space/some-component.

Or could it even be used as default? Is the current humanized form relied upon?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
Turbo87commented, Feb 8, 2017

I tend to agree that this is confusing default behavior and I often hand edit the name myself because the humanizer invented some bad looking name for the component or module. For a foo-bar component we already have the name foo-bar (or component:foo-bar) and the FooBarComponent when using globals. Why should there be a third name foo bar which does not related to the filename or the global? This seems confusing to me and I would support an effort to use the dasherized component/module name instead, which correlates with the filename it is stored in.

0reactions
Turbo87commented, Mar 20, 2017

@GabrielCW awesome, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipe "dasherize" is not defined. when run on angular project
If I change the file name in my files directory to test.ts it works fine, and the file is created. I am guessing...
Read more >
Schematics for libraries
When you create an Angular library, you can provide and package it with ... named __name@dasherize__.service.ts.template that defines a template to use for ......
Read more >
Creating blueprints - Advanced use - Ember CLI Guides
This token is used to provide support for generating blueprints inside addons. __test__. The __test__ token is replaced with the dasherized entity name...
Read more >
PublishTestResults@2 - Publish Test Results v2 task
Optional. Specifies a name for the test run against which the results will be reported. Variable names declared in the build or release...
Read more >
1/13/2020 Angular documentation — DevDocs Angular...
1/13/2020Angular / Schematics for Libraries — DevDocs9/11Theapply()method applies multiple rules to a source and returns the transformed source.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found