Socket
Socket
Sign inDemoInstall

typemoq

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typemoq - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

8

CHANGELOG.md

@@ -0,1 +1,7 @@

v1.2.1 / 2017-02-28
===================
* improve doc on 'setup' and function dynamic mocking
* remove @types/lodash as a runtime dependency
v1.2.0 / 2017-02-07

@@ -5,3 +11,3 @@ ===================

* support dynamic mocking of Function.prototype
* remove @type/node as a runtime dependency
* remove @types/node as a runtime dependency

@@ -8,0 +14,0 @@ v1.1.0 / 2017-01-03

4

package.json
{
"name": "typemoq",
"version": "1.2.0",
"version": "1.2.1",
"description": "A simple mocking library for TypeScript",

@@ -36,3 +36,2 @@ "author": "Florin Nitoi <florin.nitoi@gmail.com>",

"dependencies": {
"@types/lodash": "^4.14.37",
"lodash": "^4.16.4",

@@ -43,2 +42,3 @@ "postinstall-build": "^2.1.3"

"@types/chai": "^3.4.34",
"@types/lodash": "^4.14.37",
"@types/mocha": "^2.2.32",

@@ -45,0 +45,0 @@ "@types/node": "^6.0.45",

@@ -154,5 +154,13 @@ TypeMoq [![build badge](https://travis-ci.org/florinn/typemoq.svg?branch=master)](https://travis-ci.org/florinn/typemoq)

Dynamic mocks can be created from type parameters, both classes and interfaces being supported.
A dynamic mock is created by specifying a type parameter.
The following type parameters are supported:
* `Function` (as the type of a [function object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function))
* a class type
* an interface type
```typescript
// Using Function as type parameter
let mock: TypeMoq.IMock<Function> = TypeMoq.Mock.ofType<Function>();
// Using class as type parameter

@@ -181,2 +189,4 @@ let mock: TypeMoq.IMock<Bar> = TypeMoq.Mock.ofType<Bar>();

`setup` accepts a function (also referred as 'matcher') taking as input argument the type being mocked and as body the value/property/method (with arguments if that's the case) to match.
##### Parameter matchers

@@ -183,0 +193,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