@@ -11,26 +11,27 @@ describe("limit", () => {
11
11
expect ( limit ( 1 , Math . sin ) ) . toBeCloseTo ( 0.84147 ) ;
12
12
} ) ;
13
13
it ( "should return 0" , ( ) => {
14
- expect ( limit ( Infinity , ( x ) => Math . sin ( x ) / x ) ) . toBe ( 0 ) ;
14
+ expect ( limit ( 0 , ( x ) => Math . sin ( x ) / x ) ) . toBe ( 1 ) ;
15
15
} ) ;
16
16
it ( "should return 1" , ( ) => {
17
- expect ( limit ( Infinity , ( x ) => Math . cos ( x ) / x ) ) . toBe ( 1 ) ;
17
+ expect ( limit ( 0 , ( x ) => Math . cos ( x ) / x ) ) . toBe ( 0 ) ;
18
18
} ) ;
19
19
it ( "should throw error" , ( ) => {
20
- expect ( ( ) => limit ( "10" , ( x ) => Math . cos ( x ) / x ) ) . toThrow ( TypeError ) ;
20
+ expect ( limit ( "10" , ( x ) => Math . cos ( x ) / x ) ) . toThrow ( TypeError ) ;
21
21
} ) ;
22
22
it ( "should throw error" , ( ) => {
23
- expect ( ( ) => limit ( 10 , "x" ) ) . toThrow ( SyntaxError ) ;
23
+ expect ( limit ( 10 , "x" ) ) . toThrow ( SyntaxError ) ;
24
24
} ) ;
25
25
it ( "should throw error" , ( ) => {
26
- expect ( ( ) => limit ( 10 , ( x ) => Math . cos ( x ) / x , 12 ) ) . toThrow ( TypeError ) ;
26
+ expect ( limit ( 10 , ( x ) => Math . cos ( x ) / x , 12 ) ) . toThrow ( TypeError ) ;
27
27
} ) ;
28
28
it ( "should throw error" , ( ) => {
29
- expect ( ( ) => limit ( 10 , ( x ) => Math . cos ( x ) / x , 0 ) ) . toThrow ( TypeError ) ;
29
+ expect ( limit ( 10 , ( x ) => Math . cos ( x ) / x , 0 ) ) . toThrow ( TypeError ) ;
30
30
} ) ;
31
31
it ( "should throw error" , ( ) => {
32
- expect ( ( ) =>
32
+ expect (
33
33
limit ( 10 , ( x ) => {
34
+ console . log ( x ) ;
34
35
return "abc" ;
35
36
} )
36
37
) . toThrow ( TypeError ) ;
0 commit comments