moq.ts
moq.ts copied to clipboard
Moq for Typescript
[Proxy isExtesible](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/isExtensible) ``` typescript const mock = new Mock void>() .object(); Object.preventExtensions(mock); // now the following is not possible mock["property"] = 1; delete mock.property1; ```
```typescript const mock1 = new Mock() .setup(instance => instance.some()) .returns(true); const mock2 = new Mock() .setup(instance => instance.some()) .returns(true); //preferred way to implement const sequence = new Sequence() .insequence(mock1, instance...
[Proxy ownKeys](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/ownKeys)
[Proxy deleteProperty](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/deleteProperty)
The mocked object should track all interactions
I have multiple tests calling a single mock method to test various test cases. After each test I want to reset the mock call count so that I can verify...
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | |---|---| | terser | [`5.11.0` -> `5.14.2`](https://renovatebot.com/diffs/npm/terser/5.11.0/5.14.2) | ### GitHub Vulnerability Alerts #### [CVE-2022-25858](https://nvd.nist.gov/vuln/detail/CVE-2022-25858) The package terser...
Bumps [parse-url](https://github.com/IonicaBizau/parse-url) from 6.0.0 to 6.0.5. Commits See full diff in compare view [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter...