jasmine-auto-spies
Advanced tools
Comparing version 6.4.0 to 6.4.1
@@ -6,2 +6,13 @@ # Change Log | ||
## [6.4.1](https://github.com/hirezio/auto-spies/compare/jasmine-auto-spies@6.4.0...jasmine-auto-spies@6.4.1) (2020-11-19) | ||
### Bug Fixes | ||
* **global:** fix null return value bug ([a9bb0a9](https://github.com/hirezio/auto-spies/commit/a9bb0a988d913f3a1192d736a583c34fbc5aefb1)), closes [#38](https://github.com/hirezio/auto-spies/issues/38) | ||
# [6.4.0](https://github.com/hirezio/auto-spies/compare/jasmine-auto-spies@6.3.4...jasmine-auto-spies@6.4.0) (2020-10-19) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "jasmine-auto-spies", | ||
"version": "6.4.0", | ||
"version": "6.4.1", | ||
"author": { | ||
@@ -45,3 +45,3 @@ "name": "Shai Reznik", | ||
"dependencies": { | ||
"@hirez_io/auto-spies-core": "1.2.0" | ||
"@hirez_io/auto-spies-core": "1.2.1" | ||
}, | ||
@@ -53,3 +53,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "6e50d58d57803b4508c5d58f005b98424c3a5e0c" | ||
"gitHead": "01abe696566ec155c9088acddb1ab3bc6a0d1454" | ||
} |
@@ -11,3 +11,3 @@ # jasmine-auto-spies | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-) | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-8-green.svg?style=flat-square)](#contributors-) | ||
@@ -19,3 +19,3 @@ <!-- ALL-CONTRIBUTORS-BADGE:END --> | ||
<div align="center"> | ||
<a href="http://testangular.com/?utm_source=github&utm_medium=link&utm_campaign=jasmine+auto+spies"> | ||
<a href="https://learn.hirez.io/?utm_source=github&utm_medium=link&utm_campaign=jasmine+auto+spies"> | ||
<img src="../../for-readme/test-angular.jpg" | ||
@@ -37,2 +37,13 @@ alt="TestAngular.com - Free Angular Testing Workshop - The Roadmap to Angular Testing Mastery" | ||
<div> | ||
<a href="https://twitter.com/angular/status/1318492030016884736"> | ||
<img src="https://user-images.githubusercontent.com/1430726/97088487-c9d41b00-1639-11eb-814f-2c2c7258448e.png" | ||
alt="Angular Tweet about Jasmine-auto-spies" | ||
width="500" | ||
/> | ||
</a> | ||
</div> | ||
<br/> | ||
# Table of Contents | ||
@@ -216,3 +227,3 @@ | ||
import { MyService } from './my-service'; | ||
import { Spy, createSpyFromClass } from 'jest-auto-spies'; | ||
import { Spy, createSpyFromClass } from 'jasmine-auto-spies'; | ||
@@ -661,2 +672,6 @@ let serviceUnderTest: MyService; | ||
</tr> | ||
<tr> | ||
<td align="center"><a href="https://github.com/GuilleEneas"><img src="https://avatars0.githubusercontent.com/u/5407478?v=4" width="100px;" alt=""/><br /><sub><b>Guille Eneas TimΓ³n Grau</b></sub></a><br /><a href="https://github.com/hirezio/auto-spies/commits?author=GuilleEneas" title="Code">π»</a> <a href="https://github.com/hirezio/auto-spies/commits?author=GuilleEneas" title="Tests">β οΈ</a></td> | ||
<td align="center"><a href="https://www.coding-academy.ca/"><img src="https://avatars0.githubusercontent.com/u/2942116?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Laurent Duveau </b></sub></a><br /><a href="https://github.com/hirezio/auto-spies/commits?author=ldex" title="Documentation">π</a></td> | ||
</tr> | ||
</table> | ||
@@ -663,0 +678,0 @@ |
@@ -24,3 +24,6 @@ import { createSpyFromClass } from '../create-spy-from-class'; | ||
}) { | ||
expect(throwArgumentsErrorSpyFunction).toHaveBeenCalledWith(actualArgs, expectedMethodName); | ||
expect(throwArgumentsErrorSpyFunction).toHaveBeenCalledWith( | ||
actualArgs, | ||
expectedMethodName | ||
); | ||
} | ||
@@ -83,3 +86,4 @@ | ||
describe('GIVEN a synchronous method is being configured with specific parameters', () => { | ||
describe(`GIVEN a synchronous method is being configured with specific parameters | ||
and returns a non undefined value`, () => { | ||
Given(() => { | ||
@@ -100,2 +104,12 @@ fakeArgs = [1, { a: 2 }]; | ||
describe('WHEN it is called with the wrong parameters', () => { | ||
When(() => { | ||
actualResult = fakeClassSpy.getSyncValue(WRONG_VALUE); | ||
}); | ||
Then('return undefined', () => { | ||
expect(actualResult).toBeUndefined(); | ||
}); | ||
}); | ||
describe(`GIVEN another calledWith is configured | ||
@@ -135,2 +149,19 @@ WHEN method is called twice`, () => { | ||
describe(`GIVEN a synchronous method is being configured with specific parameters | ||
and returns a null value | ||
WHEN called with the matching parameters`, () => { | ||
Given(() => { | ||
fakeArgs = [1, { a: 2 }]; | ||
fakeClassSpy.getSyncValue.calledWith(...fakeArgs).returnValue(null); | ||
}); | ||
When(() => { | ||
actualResult = fakeClassSpy.getSyncValue(...fakeArgs); | ||
}); | ||
Then('return null', () => { | ||
expect(actualResult).toBeNull(); | ||
}); | ||
}); | ||
describe(`GIVEN a synchronous method is configured to throw on mismatch | ||
@@ -137,0 +168,0 @@ WHEN called with the wrong parameters`, () => { |
Sorry, the diff of this file is not supported yet
148993
1377
686
+ Added@hirez_io/auto-spies-core@1.2.1(transitive)
- Removed@hirez_io/auto-spies-core@1.2.0(transitive)