This repository has been archived by the owner on Oct 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22aa1d0
commit 0a94843
Showing
5 changed files
with
77 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { makeFunction } from "helpers/make-function"; | ||
|
||
/** | ||
* Check if is an number divisible by 10 | ||
*/ | ||
export const isDivisibleByTen = makeFunction<number>({ | ||
func: (nbr: number) => nbr % 10 === 0, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { isDivisibleByTen } from "checks/number/is-divisible-by-ten"; | ||
|
||
/** | ||
* | ||
* True | ||
* | ||
*/ | ||
|
||
describe("isDivisibleByTen (return True)", () => { | ||
it("10", () => { | ||
const result = isDivisibleByTen(10); | ||
expect(result).toBe(true); | ||
}); | ||
|
||
it("20", () => { | ||
const result = isDivisibleByTen(20); | ||
expect(result).toBe(true); | ||
}); | ||
|
||
it("30", () => { | ||
const result = isDivisibleByTen(30); | ||
expect(result).toBe(true); | ||
}); | ||
}); | ||
|
||
/** | ||
* | ||
* False | ||
* | ||
*/ | ||
|
||
describe("isDivisibleByTen (return False)", () => { | ||
it("15", () => { | ||
const result = isDivisibleByTen(15); | ||
expect(result).toBe(false); | ||
}); | ||
|
||
it("23", () => { | ||
const result = isDivisibleByTen(23); | ||
expect(result).toBe(false); | ||
}); | ||
|
||
it("27", () => { | ||
const result = isDivisibleByTen(27); | ||
expect(result).toBe(false); | ||
}); | ||
}); |