-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bugs): fall back to email if provided
If a bugs url is not provided, but a `mailto` is, then that is used. PR-URL: #3052 Credit: @Yash-Singh1 Close: #3052 Reviewed-by: @wraithgar
- Loading branch information
1 parent
58914be
commit f9b639e
Showing
3 changed files
with
19 additions
and
4 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
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 |
---|---|---|
|
@@ -31,6 +31,16 @@ const pacote = { | |
version: '1.2.3', | ||
repository: { url: 'https://github.com/foo/repoobj' }, | ||
} | ||
: spec === 'mailtest' ? { | ||
name: 'mailtest', | ||
version: '3.7.4', | ||
bugs: { email: '[email protected]' }, | ||
} | ||
: spec === 'secondmailtest' ? { | ||
name: 'secondmailtest', | ||
version: '0.1.1', | ||
bugs: { email: '[email protected]' }, | ||
} | ||
: spec === '.' ? { | ||
name: 'thispkg', | ||
version: '1.2.3', | ||
|
@@ -59,14 +69,16 @@ t.test('usage', (t) => { | |
t.end() | ||
}) | ||
|
||
t.test('open bugs urls', t => { | ||
t.test('open bugs urls & emails', t => { | ||
const expect = { | ||
nobugs: 'https://www.npmjs.com/package/nobugs', | ||
'bugsobj-nourl': 'https://www.npmjs.com/package/bugsobj-nourl', | ||
bugsurl: 'https://bugzilla.localhost/bugsurl', | ||
bugsobj: 'https://bugzilla.localhost/bugsobj', | ||
repourl: 'https://github.com/foo/repourl/issues', | ||
repoobj: 'https://github.com/foo/repoobj/issues', | ||
mailtest: 'mailto:[email protected]', | ||
secondmailtest: 'mailto:[email protected]', | ||
'.': 'https://example.com', | ||
} | ||
const keys = Object.keys(expect) | ||
|