File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 11import { addTwoDigits } from './addTwoDigits' ;
22
3- xdescribe ( addTwoDigits . name , ( ) => {
3+ describe ( addTwoDigits . name , ( ) => {
44 it ( 'Test 1' , ( ) => {
55 // arrange
66 const data = 29 ;
Original file line number Diff line number Diff line change 1+
12export function addTwoDigits ( n : any ) : number {
23
4+ const numberToString = n . toString ( ) ;
5+ console . log ( typeof numberToString )
6+
7+ const numberArray = numberToString . split ( '' ) ;
8+ console . log ( numberArray )
9+
10+ const numberOne = parseInt ( numberArray [ 0 ] ) ;
11+ console . log ( typeof numberOne )
12+
13+ const numberTwo = parseInt ( numberArray [ 1 ] ) ;
14+ console . log ( typeof numberTwo )
15+
16+ const total = numberOne + numberTwo ;
17+ console . log ( total ) ;
18+
19+ return total ;
320}
421
5- // console.log(addTwoDigits(29));
22+ console . log ( addTwoDigits ( 29 ) ) ;
You can’t perform that action at this time.
0 commit comments