Conversation
…-mockito into johanblumenberg-matcher-types # Conflicts: # src/ts-mockito.ts # test/matcher/type/DeepEqualMatcher.spec.ts
Codecov Report
@@ Coverage Diff @@
## master #8 +/- ##
==========================================
+ Coverage 93.41% 93.64% +0.23%
==========================================
Files 34 36 +2
Lines 653 677 +24
Branches 80 84 +4
==========================================
+ Hits 610 634 +24
Misses 30 30
Partials 13 13
Continue to review full report at Codecov.
|
src/matcher/type/EndsWithMatcher.ts
Outdated
| super(); | ||
| } | ||
|
|
||
| public match(value: Object): boolean { |
There was a problem hiding this comment.
value should be string IMO
src/matcher/type/EndsWithMatcher.ts
Outdated
| import { Matcher } from "./Matcher"; | ||
|
|
||
| export class EndsWithMatcher extends Matcher { | ||
| constructor(private expectedValue: any) { |
There was a problem hiding this comment.
expectedValue should be string
| import { Matcher } from "./Matcher"; | ||
|
|
||
| export class StartsWithMatcher extends Matcher { | ||
| constructor(private expectedValue: any) { |
There was a problem hiding this comment.
same type related comments as in endsWithMatcher..
src/ts-mockito.ts
Outdated
| return new MatchingStringMatcher(expectedValue) as any; | ||
| } | ||
|
|
||
| export function startsWith(expectedValue: string): string { |
There was a problem hiding this comment.
should return Matcher and no need for the any casting
src/ts-mockito.ts
Outdated
| } | ||
|
|
||
| export function endsWith(expectedValue: string): string { | ||
| return new EndsWithMatcher(expectedValue) as any; |
test/MethodAction.spec.ts
Outdated
|
|
||
| // when | ||
| const result = testObj.isApplicable(methodName, [strictEqual(firstArg), strictEqual(secondArg)]); | ||
| const result = testObj.isApplicable(methodName, [strictEqual(firstArg) as any, strictEqual(secondArg) as any]); |
There was a problem hiding this comment.
strictEqual should return Matcher and there's no need for casting to any
|
@cspotcode I fixed some of the types in the original PR, a matcher function should return a matcher type not any, the tests were actually expected a matcher. |
|
Is there a reason to no merge this? besides conflicts? |
@roypeled Not that I remember |
No description provided.