From fc9725de7fc57777d4633362d0437284db7b478b Mon Sep 17 00:00:00 2001 From: Cody Loyd Date: Fri, 25 Aug 2017 10:27:07 -0500 Subject: [PATCH] add tempConversion --- .gitignore | 1 + 06-tempConversion/README.md | 5 +++++ 06-tempConversion/tempConversion.js | 12 ++++++++++ 06-tempConversion/tempConversion.spec.js | 28 ++++++++++++++++++++++++ README.md | 3 --- 5 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 06-tempConversion/README.md create mode 100644 06-tempConversion/tempConversion.js create mode 100644 06-tempConversion/tempConversion.spec.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..600d2d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode \ No newline at end of file diff --git a/06-tempConversion/README.md b/06-tempConversion/README.md new file mode 100644 index 0000000..e728e42 --- /dev/null +++ b/06-tempConversion/README.md @@ -0,0 +1,5 @@ +# Exercise 06 - tempConversion + +This exercise asks you to create more than one function so the module.exports section of the spec file looks a little different this time. Nothing to worry about, we're just packaging the functions into an object to be exported. + + diff --git a/06-tempConversion/tempConversion.js b/06-tempConversion/tempConversion.js new file mode 100644 index 0000000..969c37e --- /dev/null +++ b/06-tempConversion/tempConversion.js @@ -0,0 +1,12 @@ +var ftoc = function() { + +} + +var ctof = function() { + +} + +module.exports = { + ftoc, + ctof +} diff --git a/06-tempConversion/tempConversion.spec.js b/06-tempConversion/tempConversion.spec.js new file mode 100644 index 0000000..9bbbe5e --- /dev/null +++ b/06-tempConversion/tempConversion.spec.js @@ -0,0 +1,28 @@ +var {ftoc, ctof} = require('./tempConversion') + +describe('ftoc', function() { + it('works', function() { + expect(ftoc(32)).toEqual(0); + }); + xit('rounds to 1 decimal', function() { + expect(ftoc(100)).toEqual(37.8); + }); + xit('works with negatives', function() { + expect(ftoc(-100)).toEqual(-73.3); + }); + xit('works', function() { + expect(ctof()).toEqual('ctof'); + }); +}); + +describe('ctof', function() { + xit('works', function() { + expect(ctof(0)).toEqual(32); + }); + xit('rounds to 1 decimal', function() { + expect(ctof(73.2)).toEqual(163.8); + }); + xit('works with negatives', function() { + expect(ctof(-10)).toEqual(14); + }); +}); diff --git a/README.md b/README.md index db6564d..100e730 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,11 @@ The first exercise, `helloWorld` will walk you through the process in more depth ## planned exercises (in no particular order for the moment): -1. calculate factorial -1. temperature conversion 1. book titles 1. leap years 1. Caesar Cipher 1. Palindromes 1. Pangrams -1. sum numbers in range: sumAll(1,4) (sums all numbers between and including 1 and 4) 1. pig latin 1. fibonacci 1. convert to snake case \ No newline at end of file