-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from rkitover/replace-isemail
Replace isemail to fix deprecation warning
- Loading branch information
Showing
5 changed files
with
77 additions
and
43 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
|
@@ -268,6 +268,18 @@ describe('link-check', function () { | |
}); | ||
}); | ||
|
||
it('should handle timeout for mailto validation', function (done) { | ||
linkCheck('mailto:[email protected]', { timeout: '1ms' }, function (err, result) { | ||
expect(err).to.be(null); | ||
expect(result.link).to.be('mailto:[email protected]'); | ||
expect(result.status).to.be('dead'); | ||
expect(result.statusCode).to.be(0); | ||
expect(result.err.code).to.be('ECONNRESET'); | ||
expect(result.err.message).to.be('Domain MX lookup timed out'); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('should handle valid mailto with encoded characters in address', function (done) { | ||
linkCheck('mailto:foo%[email protected]', function (err, result) { | ||
expect(err).to.be(null); | ||
|
@@ -286,6 +298,15 @@ describe('link-check', function () { | |
}); | ||
}); | ||
|
||
it('should handle valid mailto with invalid domain without MX record', function (done) { | ||
linkCheck('mailto:[email protected]', function (err, result) { | ||
expect(err).to.be(null); | ||
expect(result.link).to.be('mailto:[email protected]'); | ||
expect(result.status).to.be('dead'); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('should handle invalid mailto', function (done) { | ||
linkCheck('mailto:foo@@bar@@baz', function (err, result) { | ||
expect(err).to.be(null); | ||
|