-
Notifications
You must be signed in to change notification settings - Fork 11
feat: Enable HTTP inspection even for absolute links #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -135,6 +135,14 @@ tester.run("no-dead-link", rule, { | |
| userAgent: | ||
| "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36" | ||
| } | ||
| }, | ||
| // Test whether an absolute path can be resolved for `httpOnly` option | ||
| { | ||
| text: "should be able to check absolute path when httpOnly is true: [example](/200)", | ||
| options: { | ||
| httpOnly: true, | ||
| baseURI: TEST_SERVER_URL | ||
| } | ||
| } | ||
| // https://github.com/textlint-rule/textlint-rule-no-dead-link/issues/125 | ||
| // SKIP: External service test (consul.io redirects too many times) | ||
|
|
@@ -278,6 +286,21 @@ tester.run("no-dead-link", rule, { | |
| } | ||
| } | ||
| ] | ||
| }, | ||
| // If not `httpOnly`, test whether the absolute path can be resolved | ||
| { | ||
| text: "should be able to check absolute path when httpOnly is false: [example](/200)", | ||
| options: { | ||
| httpOnly: false, | ||
| baseURI: TEST_SERVER_URL | ||
| }, | ||
| errors: [ | ||
| { | ||
| message: `/200 is dead. (ENOENT: no such file or directory, access '${process.platform === "win32" ? "D:\\" : "/"}200')`, | ||
|
||
| line: 1, | ||
| column: 73 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you avoid to use
!.It is not type safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your feedback!
I fixed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2126d96