-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(unit-tests): add minimal unit-test-setup
- Loading branch information
Showing
5 changed files
with
1,056 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
open Jest; | ||
|
||
open Expect; | ||
|
||
describe("`keyHasher`", () => | ||
test("should return the expected hash", () => | ||
expect(Utils.keyHasher("It was a long and lonely road")) | ||
|> toEqual("2476213412") | ||
) | ||
); | ||
|
||
describe("`generateImgUrl`", () => | ||
test("should build asset-server-url", () => | ||
expect(Utils.generateImgUrl("test")) | ||
|> toBe( | ||
"https://s3.eu-central-1.amazonaws.com/punk-api-images/resized/test.jpg" | ||
) | ||
) | ||
); | ||
|
||
describe("`getFileName`", () => { | ||
describe("with valid url", () => | ||
test("should extract the filename without extension", () => | ||
expect( | ||
Utils.getFilename("http:https://www.example.org/v2/tarball/example.png") | ||
) | ||
|> toEqual(Some("example")) | ||
) | ||
); | ||
describe("with empty url", () => | ||
test("should return `None`", () => | ||
expect(Utils.getFilename("")) |> toEqual(None) | ||
) | ||
); | ||
}); |
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
Oops, something went wrong.