Skip to content

Contribution: Create Sanity Test Suite #94

@petermsouzajr

Description

@petermsouzajr

Describe the contribution

Use command: "test:sanity": "node --experimental-vm-modules node_modules/.bin/jest --testNamePattern='\[sanity\]'",

Tasks:

  1. Configuration Check:

    • Verify that the project is correctly configured using isProjectConfigured.
    • Ensure the proper resolution of the post-install script path.
  2. Command-Line Interface (CLI):

    • Test that the CLI correctly parses the framework argument (e.g., cypress, playwright).
    • Validate that the CLI recognizes and handles the todays-report and monthly-summary commands.
    • Ensure that the CLI correctly processes optional flags (--csv, --duplicate).
    • Verify that the help message (--help) displays correctly.
  3. Google Sheets Configuration:

    • Verify that the script checks for the presence of Google Sheets configuration (GOOGLE_KEYFILE_PATH, GOOGLE_SHEET_ID).
    • Ensure the appropriate handling when Google Sheets configuration is missing (default to CSV).
  4. Post-Install Script Execution:

    • Test the execution of the post-install script if the project is not configured.
    • Validate the handling of errors during the execution of the post-install script.
  5. Daily Report Generation:

    • Verify that the handleDailyReport function is called with the correct options when the todays-report command is issued.
    • Ensure that errors during daily report generation are handled gracefully.
  6. Monthly Summary Generation:

    • Verify that the handleSummary function is called with the correct options when the monthly-summary command is issued.
    • Ensure that errors during monthly summary generation are handled gracefully.
    • Test that CSV output for monthly summaries is not supported and returns the correct error message.
  7. Main Function Execution:

    • Validate that the main function is called with the correct options when no specific command is issued.
    • Ensure that errors during the main function execution are handled gracefully.

Type of contribution

✨ Feature

Current behavior (if applicable)

No response

Suggested solution and implementation (if applicable)

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageLabel for identifying issues requiring initial review or classification

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions