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

consistently name (and rename) test files #2383

Closed
boneskull opened this issue Jul 20, 2016 · 0 comments
Closed

consistently name (and rename) test files #2383

boneskull opened this issue Jul 20, 2016 · 0 comments
Labels
nice to have enhancement proposal of low priority type: chore generally involving deps, tooling, configuration, etc.

Comments

@boneskull
Copy link
Contributor

We should rename test files in test/**/*.js to test/**/*.spec.js. This would help with quickly opening files in an IDE or text editor. I often open the wrong runnable.js:

image

Renaming the test files will eliminate potential confusion here and improve DX.

However, not everything in the glob test/**/*.js is a test.

Fixtures (e.g. test/integration/fixtures/**/*.js and others) should not be renamed to *.spec.js. Ideally we could settle on a convention (*.fixture.js?) and eliminate the weirdo filenames with umpteen extensions; multiple.done.before.js could be multiple-done-before.fixture.js, for example.

Mostly I'm looking for consistency in recognizing that I'm about to open a source file, a test file, a fixture, or whatever else.

@boneskull boneskull added status: accepting prs Mocha can use your help with this one! type: chore generally involving deps, tooling, configuration, etc. qa nice to have enhancement proposal of low priority labels Jul 20, 2016
boneskull added a commit that referenced this issue Sep 19, 2016
* issue/2383:
  rename more fixtures; closes #2383
  fix test files not using .spec suffix fix test fixtures not using .fixture suffix
1999 pushed a commit to 1999/mocha that referenced this issue Sep 19, 2016
…roperty-currentretry

* upstream/master:
  helpful error when necessary suite callback omitted; closes mochajs#1744
  Fix an issue and add relevant tests when describe and xdescribe fail when not supplied with a callback (issue mochajs#1744).
  rename more fixtures; closes mochajs#2383
  Report non-match to STDERR and exit if no files are matched (mochajs#2450)
  Exit process with correct error codes (mochajs#2445)
  fix test files not using .spec suffix fix test fixtures not using .fixture suffix
  always halt execution when async skip() called; closes mochajs#2465 (mochajs#2479)
  avoid test flake in "delay" test; closes mochajs#2469 (mochajs#2470)
  revert accidental change to bin paths
  disregard function names when testing under Node.js 6.5.0; closes mochajs#2467 (mochajs#2477)
  lints more files; add more files to lint check; closes mochajs#2457
  adds *.orig to .gitignore
  Exclude the --inspect flag
  fix check-leaks to catch a leak whose name begins with 'd'
1999 pushed a commit to 1999/mocha that referenced this issue Sep 22, 2016
…-files-cache

* upstream/master:
  attempt windows-friendly reproducible case for mochajs#2315
  fix: fix uncaught TypeError if error occurs on next tick, closes mochajs#2315 (mochajs#2439)
  helpful error when necessary suite callback omitted; closes mochajs#1744
  Fix an issue and add relevant tests when describe and xdescribe fail when not supplied with a callback (issue mochajs#1744).
  rename more fixtures; closes mochajs#2383
  Report non-match to STDERR and exit if no files are matched (mochajs#2450)
  Exit process with correct error codes (mochajs#2445)
  fix test files not using .spec suffix fix test fixtures not using .fixture suffix
  always halt execution when async skip() called; closes mochajs#2465 (mochajs#2479)
  avoid test flake in "delay" test; closes mochajs#2469 (mochajs#2470)
  revert accidental change to bin paths
  disregard function names when testing under Node.js 6.5.0; closes mochajs#2467 (mochajs#2477)
  lints more files; add more files to lint check; closes mochajs#2457
  adds *.orig to .gitignore
  Exclude the --inspect flag
  fix check-leaks to catch a leak whose name begins with 'd'
@boneskull boneskull removed the status: accepting prs Mocha can use your help with this one! label Oct 10, 2016
sgilroy pushed a commit to TwineHealth/mocha that referenced this issue Feb 27, 2019
sgilroy pushed a commit to TwineHealth/mocha that referenced this issue Feb 27, 2019
* issue/2383:
  rename more fixtures; closes mochajs#2383
  fix test files not using .spec suffix fix test fixtures not using .fixture suffix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nice to have enhancement proposal of low priority type: chore generally involving deps, tooling, configuration, etc.
Projects
None yet
Development

No branches or pull requests

1 participant