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

Prefix test results with filename when running multiple files #53

Closed
sindresorhus opened this issue Sep 17, 2015 · 8 comments · Fixed by #66
Closed

Prefix test results with filename when running multiple files #53

sindresorhus opened this issue Sep 17, 2015 · 8 comments · Fixed by #66
Labels
enhancement new functionality

Comments

@sindresorhus
Copy link
Member

We should prefix the tests with the filename minus extension and prefix test- so this isn't needed.

test-url.js with test('foo bar') would be:

✔ url - foo bar

// @floatdrop

@sindresorhus sindresorhus added the enhancement new functionality label Sep 17, 2015
@floatdrop
Copy link
Contributor

Yeah, this would be sweet ✨

@scottcorgan
Copy link

Perhaps a way to specify a regex, or something like it, for file naming conventions. I'm not opposed to opinionated libraries, but I know that some people use _url_test.js or url.test.js or __test__/url.js, etc.

Maybe something like a .avarc file would be helpful for this (and things like tap output).

@sindresorhus
Copy link
Member Author

I'm allergic to options, but I'm happy to make the normalizing smarter. Any other naming patterns you can think of?

@scottcorgan
Copy link

test/url.js, tests/urls.js is all I can think of

@Qix-
Copy link
Contributor

Qix- commented Sep 17, 2015

I personally like dot notation.

With the test name/function being testQux:

  • test/test.js or test.js => testQux (special cases)
  • test/foo.js => foo.testQux
  • test/foo/bar.js => foo.bar.testQux

etc.

@sindresorhus
Copy link
Member Author

@Qix- That won't look very pretty for test titles with spaces, which most of mine are.

test('unicorn rainbow cake') => foo.bar.unicorn rainbow.cake

Probably better to use a non-common symbol, so not to be confused when the user has a test like: test('foo - bar') too.

How about foo › bar › unicorn rainbow cake?

@Qix-
Copy link
Contributor

Qix- commented Sep 18, 2015

foo › bar › unicorn rainbow cake is great; just make sure to substitute the character on windows since it doesn't support unicode. 👍

@sindresorhus
Copy link
Member Author

@Qix- Yup, we can use figures.pointerSmall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants