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

Externalize JSON Test Files #850

Open
MaibuMaddi opened this issue Jan 10, 2024 · 0 comments
Open

Externalize JSON Test Files #850

MaibuMaddi opened this issue Jan 10, 2024 · 0 comments

Comments

@MaibuMaddi
Copy link

This pull request aims to enhance the test class by externalizing JSON data, improving readability, and promoting maintainability. Instead of embedding JSON directly in the test class, this change stores JSON data in external files, making it easier to manage, update, and collaborate on test data.

Changes Made:

  1. New Directory: Introduced a new directory named test-data to store externalized JSON files.
  2. JSON Files: Moved JSON data from the test class to individual files within the test-data directory. Each JSON file corresponds to a specific test scenario or dataset.
  3. Updated Test Class: Modified the test class to read JSON data from external files in the test-data directory.
  4. Improved Readability: This change improves the readability of the test class by reducing clutter and separating concerns.

Reasoning:

  1. Maintainability: Externalizing JSON data into separate files improves maintainability. Changes to test data can now be made without altering the test class, making it easier to manage and update.
  2. Collaboration: Storing test data in external files facilitates collaboration. Team members can modify or add test data without the need to touch the actual test class, minimizing the risk of conflicts.
  3. Readability: The separation of concerns enhances the readability of the test class. Test scenarios are now clearly defined in individual JSON files, making it easier to understand the purpose of each test.

Testing:

  1. Existing Tests: All existing tests have been verified and updated to use the externalized JSON data.
  2. New Test Data: Added a few new test data files to demonstrate the flexibility of the externalized approach.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants