Skip to content

Commit 2211be3

Browse files
authored
Merge branch 'master' into master
2 parents ff36b86 + 64d02f1 commit 2211be3

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

sketch.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// adding something to see if it will force a build
2+
13
function sum(a, b) {
24
return a + b;
35
}
@@ -29,6 +31,10 @@ function anomalyCode(x) {
2931
return '5' + x - x;
3032
}
3133

34+
35+
function fahrenheit2Celcius(F) {
36+
return (F - 32) * 5 / 9;
37+
}
3238
function anomalyCode(x) {
3339
return '5' + x - x;
3440
}
@@ -55,6 +61,7 @@ module.exports = {
5561
sayHelloTo: sayHelloTo,
5662
answer: answer,
5763
anomalyCode: anomalyCode,
64+
fahrenheit2Celcius: fahrenheit2Celcius,
5865
power: power,
5966
nOfFibonacci: nOfFibonacci,
6067
iThink: iThink

sketch.test.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
const { sum, sub, prod, digital_root, sum42, sayHelloTo, anomalyCode, power, nOfFibonacci, iThink } = require('./sketch');
1+
const { sum, sub, prod, digital_root, sum42, sayHelloTo, anomalyCode, fahrenheit2Celcius, power, nOfFibonacci, iThink } = require('./sketch');
2+
3+
24
const fs = require("fs");
35
const path = require("path");
46
const fetch = require("node-fetch");
57

8+
69
// test('adds 1 + 2 to equal 3', () => {
710
// expect(sum(1, 2)).toBe(3);
811
// });
@@ -97,6 +100,18 @@ test('anomalyCode thousand should be 50000', () => {
97100
expect(anomalyCode(7891)).toBe(50000);
98101
})
99102

103+
test('fahrenheit2Celcius function exists', () => {
104+
expect(fahrenheit2Celcius(1)).toBeDefined();
105+
})
106+
107+
test('fahrenheit2Celcius 32 F should be 0 C', () => {
108+
expect(fahrenheit2Celcius(32)).toBe(0);
109+
})
110+
111+
test('fahrenheit2Celcius 50 F should be 10 C', () => {
112+
expect(fahrenheit2Celcius(50)).toBe(10);
113+
})
114+
100115
test('power of one number', () => {
101116
expect(power(2, 2)).toBe(4);
102117
})

0 commit comments

Comments
 (0)