-
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
6de7cde
commit 73a2136
Showing
3 changed files
with
43 additions
and
0 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,37 @@ | ||
import linkInspector from "../index"; | ||
|
||
test('Broken link calls callback', async () => { | ||
const promise1 = new Promise<void>((resolve) => { | ||
const callback = (link: string) => { | ||
expect(link).toBe('https://www.google.com/page-not-found'); | ||
resolve(); | ||
}; | ||
|
||
linkInspector("https://www.google.com/page-not-found", callback); | ||
}); | ||
|
||
const promise2 = new Promise<void>((resolve) => { | ||
const callback = (link: string) => { | ||
expect(link).toBe('https://www.wikipedia.org/page-not-found'); | ||
resolve(); | ||
}; | ||
|
||
linkInspector("https://www.wikipedia.org/page-not-found", callback); | ||
}); | ||
|
||
await promise1; | ||
await promise2; | ||
}); | ||
|
||
test('Test on real folder', async () => { | ||
const promise = new Promise<void>((resolve) => { | ||
const callback = (link: string) => { | ||
expect(link).toBe('https://www.wikipedia.org/page-not-found'); | ||
resolve(); | ||
}; | ||
|
||
linkInspector("tests/test-folder", callback); | ||
}); | ||
|
||
await promise; | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,6 @@ | ||
bowishadve https://www.google.com/ tribution pendaytive | ||
astrus digikiki quz trudicats alginall shopolized | ||
beatorlds reflupper https://www.wikipedia.org/page-not-found | ||
nucch sa eadicerolawyne antilds ij nessinfulleter | ||
expercity larv posion vikins revotempution norted | ||
https://www.un.org/ sweeds corehooker iwoppion burgination |