1- const { sum, sub, prod, digital_root, sum42, sayHelloTo, anomalyCode, power, nOfFibonacci } = require ( './sketch' ) ;
1+
2+ const { sum, sub, prod, digital_root, sum42, sayHelloTo, anomalyCode, fahrenheit2Celcius, power, nOfFibonacci } = require ( './sketch' ) ;
3+
4+
25const fs = require ( "fs" ) ;
36const path = require ( "path" ) ;
47const fetch = require ( "node-fetch" ) ;
58
9+
610// test('adds 1 + 2 to equal 3', () => {
711// expect(sum(1, 2)).toBe(3);
812// });
@@ -97,6 +101,18 @@ test('anomalyCode thousand should be 50000', () => {
97101 expect ( anomalyCode ( 7891 ) ) . toBe ( 50000 ) ;
98102} )
99103
104+ test ( 'fahrenheit2Celcius function exists' , ( ) => {
105+ expect ( fahrenheit2Celcius ( 1 ) ) . toBeDefined ( ) ;
106+ } )
107+
108+ test ( 'fahrenheit2Celcius 32 F should be 0 C' , ( ) => {
109+ expect ( fahrenheit2Celcius ( 32 ) ) . toBe ( 0 ) ;
110+ } )
111+
112+ test ( 'fahrenheit2Celcius 50 F should be 10 C' , ( ) => {
113+ expect ( fahrenheit2Celcius ( 50 ) ) . toBe ( 10 ) ;
114+ } )
115+
100116test ( 'power of one number' , ( ) => {
101117 expect ( power ( 2 , 2 ) ) . toBe ( 4 ) ;
102118} )
@@ -128,4 +144,4 @@ it('tests url avaliability in README.md', async () => {
128144 let [ testCount , testFunc ] = testUrlInMarkdown ( "README.md" ) ;
129145 jest . setTimeout ( testCount * 5000 ) ;
130146 return await testFunc ( ) ;
131- } ) ;
147+ } ) ;
0 commit comments