diff --git a/07_tempConversion/tempConversion.js b/07_tempConversion/tempConversion.js index abea34c..ebc51d9 100644 --- a/07_tempConversion/tempConversion.js +++ b/07_tempConversion/tempConversion.js @@ -1,5 +1,5 @@ const convertToCelsius = function(deg) { - return (deg - 32) * (5/9); + return Math.round((deg - 32) * (5/9) * 10) / 10; }; const convertToFahrenheit = function() { diff --git a/07_tempConversion/tempConversion.spec.js b/07_tempConversion/tempConversion.spec.js index c4f9742..8bbd385 100644 --- a/07_tempConversion/tempConversion.spec.js +++ b/07_tempConversion/tempConversion.spec.js @@ -4,10 +4,10 @@ describe('convertToCelsius', () => { test('works', () => { expect(convertToCelsius(32)).toEqual(0); }); - test.skip('rounds to 1 decimal', () => { + test('rounds to 1 decimal', () => { expect(convertToCelsius(100)).toEqual(37.8); }); - test.skip('works with negatives', () => { + test('works with negatives', () => { expect(convertToCelsius(-100)).toEqual(-73.3); }); });