Skip to content

Commit

Permalink
feat: division capability (#15)
Browse files Browse the repository at this point in the history
* feat: ✨ add divide function

* test: add test for divide function
  • Loading branch information
mattwilson1024 committed May 13, 2020
1 parent 9b34887 commit 74d21d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sum, subtract, multiply } from './main';
import { sum, subtract, multiply, divide } from './main';

describe('example functions', () => {
it('should sum two numbers', () => {
Expand All @@ -12,4 +12,8 @@ describe('example functions', () => {
it('should multiply two numbers', () => {
expect(multiply(2, 3)).toBe(6);
})

it('should divide two numbers', () => {
expect(divide(6, 2)).toBe(3);
})
});
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ export function subtract(a: number, b: number): number {

export function multiply(x: number, y: number): number {
return x * y;
}

export function divide(x: number, y: number): number {
return x / y;
}

0 comments on commit 74d21d8

Please sign in to comment.