-
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.
- Loading branch information
1 parent
07e8a27
commit 6de7cde
Showing
14 changed files
with
3,298 additions
and
365 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
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,37 @@ | ||
import { checkLink } from "../checkLink"; | ||
|
||
test('api. returns false', async () => { | ||
expect(await checkLink("https://api.pythagora.io/telemetry")).toBe(false); | ||
}); | ||
|
||
test('localhost returns false', async () => { | ||
expect(await checkLink("https://localhost/")).toBe(false); | ||
expect(await checkLink("https://127.0.0.1/")).toBe(false); | ||
}); | ||
|
||
test('White Listed URLS return false', async () => { | ||
expect(await checkLink("https://www.google.com/")).toBe(false); | ||
expect(await checkLink("https://example.com/")).toBe(false); | ||
expect(await checkLink("https://www.example.com/")).toBe(false); | ||
expect(await checkLink("https://example.org/")).toBe(false); | ||
expect(await checkLink("https://www.example.org/")).toBe(false); | ||
expect(await checkLink("https://goo.gl/")).toBe(false); | ||
expect(await checkLink("https://fonts.googleapis.com")).toBe(false); | ||
expect(await checkLink("https://fonts.gstatic.com")).toBe(false); | ||
}); | ||
|
||
test('Valid Links return false', async () => { | ||
expect(await checkLink("https://www.google.com/")).toBe(false); | ||
expect(await checkLink("https://www.wikipedia.org/")).toBe(false); | ||
expect(await checkLink("https://www.nasa.gov/")).toBe(false); | ||
expect(await checkLink("https://www.bbc.com/")).toBe(false); | ||
expect(await checkLink("https://www.un.org/")).toBe(false); | ||
}); | ||
|
||
test('Broken Links return true', async () => { | ||
expect(await checkLink("https://www.google.com/page-not-found")).toBe(true); | ||
expect(await checkLink("https://www.wikipedia.org/page-not-found")).toBe(true); | ||
expect(await checkLink("https://www.nasa.gov/page-not-found")).toBe(true); | ||
expect(await checkLink("https://www.bbc.com/page-not-found")).toBe(true); | ||
expect(await checkLink("https://www.un.org/page-not-found")).toBe(true); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.