File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ import { TestingActual } from "../lib" ;
2+
3+ const t = new TestingActual ( ) ;
4+
5+ class ClassA {
6+ public methodA ( value ?: any ) {
7+ return "methodA" ;
8+ }
9+
10+ public methodB ( value ?: any ) {
11+ return "methodB" ;
12+ }
13+ }
14+
15+ const classA = new ClassA ( ) ;
16+
17+ t . describe ( 'TestingActual' , ( ) => {
18+
19+ //
20+ t
21+ . actual ( 'a b c d e f g h i j k l m n o p r s' )
22+ . toBeString ( )
23+ . stringIncludes ( [ 'f' ] )
24+ . stringIncludesSome ( [ 'f' , 'z' ] )
25+ . stringOfLengthBetween ( 27 , 47 )
26+ . toBeStringType ( )
27+
28+ t
29+ . beforeEach ( ( ) => {
30+ spyOn ( classA , "methodA" ) ;
31+ classA . methodA ( { test : 27 } ) ;
32+ } )
33+ . spy ( ( ) => classA . methodA )
34+ . toHaveBeenCalled ( )
35+ . toHaveBeenCalledWith ( { test : 27 } )
36+ . toHaveBeenCalledTimes ( 1 )
37+ . toHaveBeenCalledOnceWith ( { test : 27 } )
38+ } ) ;
You can’t perform that action at this time.
0 commit comments