Skip to content

Commit

Permalink
add tempConversion
Browse files Browse the repository at this point in the history
  • Loading branch information
codyloyd committed Aug 25, 2017
1 parent fe087fd commit fc9725d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode
5 changes: 5 additions & 0 deletions 06-tempConversion/README.md
Original file line number Diff line number Diff line change
@@ -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.


12 changes: 12 additions & 0 deletions 06-tempConversion/tempConversion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var ftoc = function() {

}

var ctof = function() {

}

module.exports = {
ftoc,
ctof
}
28 changes: 28 additions & 0 deletions 06-tempConversion/tempConversion.spec.js
Original file line number Diff line number Diff line change
@@ -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);
});
});
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fc9725d

Please sign in to comment.