@@ -4,6 +4,9 @@ import { describe, it } from "mocha";
44import Calculator from "../src/Calculator" ;
55
66describe ( "Calculator" , ( ) => {
7+ it ( "has the correct initial value when no argument is supplied" , ( ) => expect ( new Calculator ( ) . value ( ) ) . equal ( 0 ) ) ;
8+ it ( "has the correct initial value when an argument is supplied" , ( ) => expect ( new Calculator ( 3 ) . value ( ) ) . equal ( 3 ) ) ;
9+
710 const calculator = new Calculator ( ) ;
811
912 it ( "can add" , ( ) => expect ( calculator . add ( 2 ) . value ( ) ) . equal ( 2 ) ) ;
@@ -14,11 +17,9 @@ describe("Calculator", () => {
1417 // prettier-ignore
1518 it ( "can exp" , ( ) => expect ( calculator . sub ( 1 ) . exp ( ) . value ( ) ) . equal ( Math . E ) ) ;
1619 it ( "can ln" , ( ) => expect ( calculator . ln ( ) . value ( ) ) . equal ( 1 ) ) ;
17-
1820 it ( "can clear" , ( ) => expect ( calculator . clear ( ) . value ( ) ) . equal ( 0 ) ) ;
1921 it ( "can sin" , ( ) => expect ( calculator . sin ( ) . value ( ) ) . equal ( 0 ) ) ;
2022 it ( "can cos" , ( ) => expect ( calculator . cos ( ) . value ( ) ) . equal ( 1 ) ) ;
21-
22- it ( "has the correct initial value when no argument is supplied" , ( ) => expect ( new Calculator ( ) . value ( ) ) . equal ( 0 ) ) ;
23- it ( "has the correct initial value when an argument is supplied" , ( ) => expect ( new Calculator ( 3 ) . value ( ) ) . equal ( 3 ) ) ;
23+ // prettier-ignore
24+ it ( "can tan" , ( ) => expect ( calculator . clear ( ) . tan ( ) . value ( ) ) . equal ( 0 ) ) ;
2425} ) ;
0 commit comments