mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
@@ -1,4 +1,4 @@
|
||||
# Exercise 07 - tempConversion
|
||||
# Exercise 06 - tempConversion
|
||||
|
||||
Write two functions that convert temperatures from Fahrenheit to Celsius, and vice versa:
|
||||
```
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
const ftoc = function() {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
const ctof = function() {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
ftoc,
|
||||
ctof
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
const {ftoc, ctof} = require('./tempConversion')
|
||||
|
||||
describe('ftoc', () => {
|
||||
test('works', () => {
|
||||
describe('ftoc', function() {
|
||||
it('works', function() {
|
||||
expect(ftoc(32)).toEqual(0);
|
||||
});
|
||||
test.skip('rounds to 1 decimal', () => {
|
||||
xit('rounds to 1 decimal', function() {
|
||||
expect(ftoc(100)).toEqual(37.8);
|
||||
});
|
||||
test.skip('works with negatives', () => {
|
||||
xit('works with negatives', function() {
|
||||
expect(ftoc(-100)).toEqual(-73.3);
|
||||
});
|
||||
});
|
||||
|
||||
describe('ctof', () => {
|
||||
test.skip('works', () => {
|
||||
describe('ctof', function() {
|
||||
xit('works', function() {
|
||||
expect(ctof(0)).toEqual(32);
|
||||
});
|
||||
test.skip('rounds to 1 decimal', () => {
|
||||
xit('rounds to 1 decimal', function() {
|
||||
expect(ctof(73.2)).toEqual(163.8);
|
||||
});
|
||||
test.skip('works with negatives', () => {
|
||||
xit('works with negatives', function() {
|
||||
expect(ctof(-10)).toEqual(14);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user