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

Add Jest for Basic Testing of Pure Functions #1033

Merged
merged 6 commits into from
Sep 21, 2023

Commits on Sep 18, 2023

  1. Configuration menu
    Copy the full SHA
    856b2d6 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2023

  1. add some DiaryHelper tests

    testing the testing framework :)
    
    my goal is to test the normal cases and the edge cases
    
    ex: isMultiDay - test one expecting true, one expecting false, and one with invalid input (so false)
    Abby Wheelis committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    4604405 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2023

  1. fix motionTypeOf function; re-enable test

    As discovered in e-mission#1033 (comment), this function was not working as expected - it formats a key for lookup, and then didn't actually use the key.
    With this fix, the test runs correctly!
    JGreenlee committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    1b49b89 View commit details
    Browse the repository at this point in the history
  2. more diaryHelper tests

    continuing to improve testing coverage for diaryHelper by adding tests for more functions
    
    For some of the functions related to a trip, I found it easiest to look at a trip in the logs, create a test trip object with the relevant parts, and then also mock the results
    Abby Wheelis committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    df60ea4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f24ce9d View commit details
    Browse the repository at this point in the history
  4. jest: ignore these directories when discover tests

    We should only look for tests in our `www/__tests__` directory, not any other `__tests__` directories that may exist in dependencies or anywhere in the project directory tree.
    Further, by explicitly ignoring these directories, we don't have to specify `npx jest www/__tests__`, and can simply run `npx jest`.
    JGreenlee committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    1d0ddca View commit details
    Browse the repository at this point in the history