ts-mockito icon indicating copy to clipboard operation
ts-mockito copied to clipboard

Matcher types

Open johanblumenberg opened this issue 5 years ago • 1 comments

Add startsWith() and endsWith() string matchers.

Update types on matchers for better type safety.

For example, before this PR, this would be compiling, even though it is invalid code:

class Foo {
  bar(value: { a: string }) {}
}

let foo = mock(Foo);
verify(foo.bar(deepEquals('hello world')).called();

johanblumenberg avatar May 25 '19 09:05 johanblumenberg

Codecov Report

Merging #139 into master will increase coverage by 0.19%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #139      +/-   ##
==========================================
+ Coverage   94.93%   95.12%   +0.19%     
==========================================
  Files          34       36       +2     
  Lines         612      636      +24     
  Branches       71       75       +4     
==========================================
+ Hits          581      605      +24     
  Misses         22       22              
  Partials        9        9
Impacted Files Coverage Δ
src/matcher/type/StartsWithMatcher.ts 100% <100%> (ø)
src/ts-mockito.ts 97.01% <100%> (+0.29%) :arrow_up:
src/matcher/type/EndsWithMatcher.ts 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 245892c...e59b0c8. Read the comment docs.

codecov-io avatar May 25 '19 09:05 codecov-io