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

Organize Jest tests by method #608

Closed
JohnAlbin opened this issue Nov 22, 2023 · 0 comments
Closed

Organize Jest tests by method #608

JohnAlbin opened this issue Nov 22, 2023 · 0 comments
Labels
area: next-drupal tooling tooling changes (CI, tests, etc.); no code changes

Comments

@JohnAlbin
Copy link
Collaborator

Package

next-drupal (NPM package)

Describe the feature request

The current Jest tests are in two files:

  • client.test.ts (2644 lines long)
  • crud.test.ts (395 lines long)

Having a 2000+ lines long test file makes it more difficult than necessary to find the tests that relate to a particular piece of code.

Also, the tests seem to be organized around "features" rather than by the specific methods; for example, setting an option in the constructor should be a constructor test and how that option affects the different methods should be tested for in those methods and not grouped by the option name.

This last point is important because it makes it easier for the developer to see how the tests cover the codebase.

Lastly, some of the next-drupal tests appear to be testing the return values of the next.module and not testing the functionality of the next-drupal codebase.

Describe the solution you'd like

Fortunately, the crud tests are already organized by method name. But the client.test.ts file needs to be split up and organized by method name.

@JohnAlbin JohnAlbin added area: next-drupal tooling tooling changes (CI, tests, etc.); no code changes labels Nov 22, 2023
JohnAlbin added a commit that referenced this issue Feb 6, 2024
JohnAlbin added a commit that referenced this issue Feb 8, 2024
JohnAlbin added a commit that referenced this issue Feb 8, 2024
JohnAlbin added a commit that referenced this issue Feb 20, 2024
JohnAlbin added a commit that referenced this issue Feb 20, 2024
@JohnAlbin JohnAlbin added this to the next-drupal 2.0.0 milestone Feb 20, 2024
JohnAlbin added a commit that referenced this issue Feb 21, 2024
JohnAlbin added a commit that referenced this issue Feb 21, 2024
JohnAlbin added a commit that referenced this issue Feb 21, 2024
marcorcau pushed a commit to marcorcau/next-drupal that referenced this issue Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: next-drupal tooling tooling changes (CI, tests, etc.); no code changes
Projects
None yet
Development

No branches or pull requests

1 participant