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

feat: Allow mocking property value in tests #13496

Merged
merged 22 commits into from Jan 4, 2023
Merged

Commits on Oct 23, 2022

  1. feat(jest-mock): Add mockProperty() method

    Michal Kočárek committed Oct 23, 2022
    Copy the full SHA
    15697c7 View commit details
    Browse the repository at this point in the history
  2. feat(jest-environment): Add mockProperty() method type to global Jest…

    … object
    Michal Kočárek committed Oct 23, 2022
    Copy the full SHA
    9c270ca View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2022

  1. refactor(jest-mock): Be more strict for MockedPropertyRestorer generi…

    …c type
    Michal Kočárek committed Dec 19, 2022
    Copy the full SHA
    20b881b View commit details
    Browse the repository at this point in the history
  2. refactor(jest-mock): Allow mocking property named '0' or ""

    Michal Kočárek committed Dec 19, 2022
    Copy the full SHA
    930036d View commit details
    Browse the repository at this point in the history
  3. refactor(jest-mock): Throw more descriptive error messages when tryin…

    …g to mock a property
    Michal Kočárek committed Dec 19, 2022
    Copy the full SHA
    c739864 View commit details
    Browse the repository at this point in the history
  4. refactor(jest-mock): Allow mocking already mocked property with diffe…

    …rent value
    Michal Kočárek committed Dec 19, 2022
    Copy the full SHA
    0f227c2 View commit details
    Browse the repository at this point in the history
  5. refactor(jest-mock): Add type tests for mockProperty

    Michal Kočárek committed Dec 19, 2022
    Copy the full SHA
    1c4535b View commit details
    Browse the repository at this point in the history
  6. refactor(jest-runtime): Fix missing mockProperty export

    Michal Kočárek committed Dec 19, 2022
    Copy the full SHA
    4a1aeb6 View commit details
    Browse the repository at this point in the history
  7. Merge remote-tracking branch 'upstream/main'

    # Conflicts:
    #	packages/jest-mock/__typetests__/mock-functions.test.ts
    Michal Kočárek committed Dec 19, 2022
    Copy the full SHA
    c79837d View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2022

  1. refactor(jest-mock): Fix typing and interface of mockProperty methods

    - Rename mockProperty to replaceProperty, as it's not exactly mocking.
    - Allow passing different types when mocking value.
    - Fix typings in TypeScript and cover them with tests.
    Michal Kočárek committed Dec 20, 2022
    Copy the full SHA
    cceffa0 View commit details
    Browse the repository at this point in the history
  2. refactor(jest-mock, docs): Document replaceProperty method and its im…

    …pact on the API
    Michal Kočárek committed Dec 20, 2022
    Copy the full SHA
    6c17cc0 View commit details
    Browse the repository at this point in the history
  3. refactor(docs): Remove forgotten TODO

    Michal Kočárek committed Dec 20, 2022
    Copy the full SHA
    d828f11 View commit details
    Browse the repository at this point in the history

Commits on Dec 25, 2022

  1. refactor(jest-mock, jest-types): Add additional tests for replaced pr…

    …operty types
    Michal Kočárek committed Dec 25, 2022
    Copy the full SHA
    4f9ac47 View commit details
    Browse the repository at this point in the history
  2. refactor(jest-environment, jest-globals): Fix JSDoc comments for repl…

    …aced property types and methods
    Michal Kočárek committed Dec 25, 2022
    Copy the full SHA
    b3fb383 View commit details
    Browse the repository at this point in the history
  3. refactor(docs): Improve style of replaced property sections and apply…

    … changes from code review
    Michal Kočárek committed Dec 25, 2022
    Copy the full SHA
    208df4d View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2023

  1. Merge branch 'main' into main

    SimenB committed Jan 3, 2023
    Copy the full SHA
    2ed2ca8 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    ba36a3b View commit details
    Browse the repository at this point in the history
  3. Merge remote-tracking branch 'upstream/main'

    # Conflicts:
    #	CHANGELOG.md
    Michal Kočárek committed Jan 3, 2023
    Copy the full SHA
    25d1b24 View commit details
    Browse the repository at this point in the history
  4. refactor(jest-mock): Fix type tests compatibility with TS 4.3

    Michal Kočárek committed Jan 3, 2023
    Copy the full SHA
    472841c View commit details
    Browse the repository at this point in the history
  5. refactor(jest-runtime): Fix forgotten rename of replaceProperty from …

    …previous commits
    Michal Kočárek committed Jan 3, 2023
    Copy the full SHA
    2f9c9c9 View commit details
    Browse the repository at this point in the history
  6. refactor(jest-mock): Hint to use replaceProperty when trying to mock …

    …primitive value
    Michal Kočárek committed Jan 3, 2023
    Copy the full SHA
    33c30b9 View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    f0ffae1 View commit details
    Browse the repository at this point in the history