jest-create-mock-instance
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ var jestMock = require("jest-mock"); |
{ | ||
"name": "jest-create-mock-instance", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Create class mock instances easily with Jest", | ||
@@ -19,8 +19,8 @@ "main": "index.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"jest-mock": ">=21.0.0" | ||
"peerDependencies": { | ||
"jest-mock": "*" | ||
}, | ||
"devDependencies": { | ||
"jest": "^21.1.0" | ||
"jest": "^21.2.1" | ||
} | ||
} |
@@ -5,3 +5,3 @@ ## Description | ||
I've been always fan of using ```sinon.createStubInstance()``` in my tests. Unfortunately, Jest doesn't expose similar API to create new mocked instance for given class constructor. Using ```jest.fn()``` is not very convienment for various cases, take an example of these classes and unit test: | ||
I've been always fan of using ```sinon.createStubInstance()``` in my tests. Unfortunately, Jest doesn't expose similar API to create new mocked instance for given class constructor. Using ```jest.fn()``` or jest's module mocks is not very convienment for various cases, take an example of these classes and unit test: | ||
@@ -49,3 +49,3 @@ | ||
By using ```jest.fn()``` you must mock your module before and instantiate ```Food``` directly: | ||
By using jest module mocks you must mock your module before and instantiate ```Food``` directly: | ||
@@ -90,3 +90,3 @@ ```js | ||
beforeEach(() => { | ||
food = createMockInstance(food); | ||
food = createMockInstance(Food); | ||
}); | ||
@@ -93,0 +93,0 @@ ``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5104
- Removedjest-mock@>=21.0.0