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

Standardize filenames in packages/expect #7306

Merged
merged 11 commits into from
Oct 31, 2018
Merged

Standardize filenames in packages/expect #7306

merged 11 commits into from
Oct 31, 2018

Conversation

andrew-pyle
Copy link
Contributor

Summary

References Standardize file naming #4969.

Updates naming in package expect. Uses conventions listed in #4969 (comment):

  • Files that primarily export types, objects or classes should use CapitalizedFileNames.js and should mirror what’s inside 1:1.
  • Files that export a single function should have the function name with camelCase in it.
  • Folder names should use dashes, unless they are special folders.

Decisions

  • Test & snapshot files retained their name, but converted it to camelCase.
  • Files which exported an object were named according to the internal object, which was camelCase. However, I believe that the standard referenced above states that objects should have CapitalizedNames. Should the internal objects be renamed too?
    • matchers.js
    • jestMatchersObject.js
    • spyMatchers.js
    • toThrowmatchers.js

Questions

How should asymmetricMatchers.js be named? It exports a class AsymmetricMatcher, but it also exports a bunch of functions, and was named in camelCase before.

Test plan

Output of yarn run test on master and standardize filenames in packages/jest circus branches was the same.

jest-test-expect-master.txt
jest-test-expect-standardize-filenames.txt

…ionsErrors.js

- Rename file & imports
- No test found
- Rename files, imports, test
- Rename import in scripts/browserBuild.js
- file, & imports
- no test found
- Rename file, imports
- No test found
- Rename file, imports, test, snap
- spyMatchers.js file follows internal object, but that object does not
  follow capitalization rule.
- #4969 (comment)
  "Files that primarily export types, objects or classes should use
  CapitalizedFileNames.js and should mirror what’s inside 1:1.""
- Rename file, imports, test, snap
- toThrowMatchers.js file follows internal object, but that object does
  not follow capitalization rule.
- #4969 (comment)
  "Files that primarily export types, objects or classes should use
  CapitalizedFileNames.js and should mirror what’s inside 1:1."
- Rename test only. Test is for isError in utils.js
- Rename test only. Test is for expect/index.js
- Rename test only. Test has no imports.
@SimenB SimenB requested a review from thymikee October 31, 2018 09:00
Copy link
Collaborator

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@thymikee thymikee merged commit 968ddc4 into jestjs:master Oct 31, 2018
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants