New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@johanblumenberg/ts-mockito

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@johanblumenberg/ts-mockito - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

2

package.json
{
"name": "@johanblumenberg/ts-mockito",
"version": "1.0.7",
"version": "1.0.8",
"description": "Mocking library for TypeScript",

@@ -5,0 +5,0 @@ "main": "lib/ts-mockito.js",

@@ -6,2 +6,5 @@ # @johanblumenberg/ts-mockito

- [Adding support for verify(...).timeout(ms)](https://github.com/NagRock/ts-mockito/pull/97)
- [Matcher types](https://github.com/NagRock/ts-mockito/pull/139)
- [Mock free functions](https://github.com/NagRock/ts-mockito/pull/140)
- [Add defer() for testing deferred promise resolution](https://github.com/NagRock/ts-mockito/pull/141)

@@ -73,8 +76,8 @@ ## Installation

### Delay resolving promises
### Defer resolving promises
The actions `.thenResolve()` and `.thenReject()` are returning promises that are already resolved or rejected. Sometimes you want to control the order or timing of when promises are resolved. In that case it is useful to return a delayed promise, and resolve it from the test code, when appropriate.
The actions `.thenResolve()` and `.thenReject()` are returning promises that are already resolved or rejected. Sometimes you want to control the order or timing of when promises are resolved. In that case it is useful to return a deferred promise, and resolve it from the test code, when appropriate.
```typescript
let d = delayed<number>();
let d = defer<number>();
when(obj.method()).thenReturn(d); // Return a promise that is not resolved yet

@@ -81,0 +84,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc