mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-18 14:13:24 +09:00
08_calculator:Add more test cases for subtract and power (#494)
This commit is contained in:
@@ -18,6 +18,14 @@ describe('subtract', () => {
|
|||||||
test.skip('subtracts numbers', () => {
|
test.skip('subtracts numbers', () => {
|
||||||
expect(calculator.subtract(10, 4)).toBe(6);
|
expect(calculator.subtract(10, 4)).toBe(6);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test.skip('subtracts negative numbers', () => {
|
||||||
|
expect(calculator.subtract(-10, -4)).toBe(-6);
|
||||||
|
});
|
||||||
|
|
||||||
|
test.skip('subtracts numbers of mixed parity', () => {
|
||||||
|
expect(calculator.subtract(-8, 7)).toBe(-15);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('sum', () => {
|
describe('sum', () => {
|
||||||
@@ -52,6 +60,10 @@ describe('power', () => {
|
|||||||
test.skip('raises one number to the power of another number', () => {
|
test.skip('raises one number to the power of another number', () => {
|
||||||
expect(calculator.power(4, 3)).toBe(64); // 4 to third power is 64
|
expect(calculator.power(4, 3)).toBe(64); // 4 to third power is 64
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test.skip('raises one number to the power of a large number', () => {
|
||||||
|
expect(calculator.power(3, 10)).toBe(59049); // 3 to tenth power is 59049
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('factorial', () => {
|
describe('factorial', () => {
|
||||||
|
|||||||
@@ -18,6 +18,14 @@ describe('subtract', () => {
|
|||||||
test('subtracts numbers', () => {
|
test('subtracts numbers', () => {
|
||||||
expect(calculator.subtract(10, 4)).toBe(6);
|
expect(calculator.subtract(10, 4)).toBe(6);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('subtracts negative numbers', () => {
|
||||||
|
expect(calculator.subtract(-10, -4)).toBe(-6);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('subtracts numbers of mixed parity', () => {
|
||||||
|
expect(calculator.subtract(-8, 7)).toBe(-15);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('sum', () => {
|
describe('sum', () => {
|
||||||
@@ -52,6 +60,10 @@ describe('power', () => {
|
|||||||
test('raises one number to the power of another number', () => {
|
test('raises one number to the power of another number', () => {
|
||||||
expect(calculator.power(4, 3)).toBe(64); // 4 to third power is 64
|
expect(calculator.power(4, 3)).toBe(64); // 4 to third power is 64
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('raises one number to the power of a large number', () => {
|
||||||
|
expect(calculator.power(3, 10)).toBe(59049); // 3 to tenth power is 59049
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('factorial', () => {
|
describe('factorial', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user