Skip to content

Commit

Permalink
Update dependency strong-mock to v9
Browse files Browse the repository at this point in the history
| datasource | package     | from  | to    |
| ---------- | ----------- | ----- | ----- |
| npm        | strong-mock | 8.0.1 | 9.0.0 |


## [v9.0.0](https://github.com/NiGhTTraX/strong-mock/blob/HEAD/CHANGELOG.md#900-2024-05-27)

This version greatly improves error messages and the matcher API. Check the [migration guide](MIGRATION.md#migrating-to-v9).

```typescript
const fn = mock<(x: number, y: number, z: { foo: string }) => number>();
when(() => fn(1, 2, { foo: 'bar' })).thenReturn(42);

fn(1, 2, { foo: 'baz' });
```

| Before                         | After                        |
|--------------------------------|------------------------------|
| ![before](media/before-v9.png) | ![after](media/after-v9.png) |

##### ⚠ BREAKING CHANGES

-   `isObject` has been replaced by `isPlainObject` and `containsObject`
-   Merge `isString`'s optional `containing` and `matching` args
-   Rename the `toJSON` matcher method to `toString`
-   Don't allow empty partials in `containsObject`

##### Features

-   Attach actual/expected args to error instance to enable IDE diffs ([7a04a43](NiGhTTraX/strong-mock@7a04a43))
-   Improve `isArray` diff ([a5aaddd](NiGhTTraX/strong-mock@a5aaddd))
-   Improve `isNumber` diff ([55647ed](NiGhTTraX/strong-mock@55647ed))
-   Improve `isObject` diff ([5533bcf](NiGhTTraX/strong-mock@5533bcf))
-   Improve `isString` diff ([5c73fbb](NiGhTTraX/strong-mock@5c73fbb))
-   Improve `willCapture` diff ([7d92ce9](NiGhTTraX/strong-mock@7d92ce9))
-   Improve colors in UnexpectedCall error message ([f326954](NiGhTTraX/strong-mock@f326954))
-   Pretty print argument diffs in UnexpectedCall error messages ([ba4f6b5](NiGhTTraX/strong-mock@ba4f6b5))

##### Bug Fixes

-   Fix `isPartial` allowing unexpected keys ([cc0b881](NiGhTTraX/strong-mock@cc0b881))
-   Fix `isPartial` not working with interfaces ([169b336](NiGhTTraX/strong-mock@169b336))
-   `isObject` now correctly fails for `null` and `undefined` ([9b50fe4](NiGhTTraX/strong-mock@9b50fe4))
-   Fix `It` docstrings ([df7f91a](NiGhTTraX/strong-mock@df7f91a))
-   Handle non string keys in `isObject` ([87cb768](NiGhTTraX/strong-mock@87cb768))
  • Loading branch information
renovate[bot] authored Oct 5, 2024
1 parent c755ad9 commit 40a2e7c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"prettier": "3.3.3",
"react": "17.0.2",
"react-dom": "17.0.2",
"strong-mock": "~8.0.1",
"strong-mock": "~9.0.0",
"stylelint": "16.9.0",
"stylelint-config-recommended": "14.0.1",
"stylelint-config-styled-components": "0.1.1",
Expand Down
36 changes: 19 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 40a2e7c

Please sign in to comment.