-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: scope install warnings to plugin being installed (#721)
- Loading branch information
1 parent
a659c74
commit 51f7721
Showing
2 changed files
with
86 additions
and
5 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,56 @@ | ||
import {expect} from 'chai' | ||
|
||
import {extractIssuesLocation} from '../src/util.js' | ||
|
||
describe('extractIssuesLocation', () => { | ||
it('should return url if pjson.bugs is a string', () => { | ||
const pjson = { | ||
bugs: 'https://github.com/oclif/plugin-plugins/issues', | ||
name: '@oclif/plugin-plugins', | ||
repository: { | ||
type: 'git', | ||
url: 'git+https://github.com/oclif/plugin-plugins.git', | ||
}, | ||
version: '1.0.0', | ||
} | ||
|
||
expect(extractIssuesLocation(pjson.bugs, pjson.repository)).to.equal(pjson.bugs) | ||
}) | ||
|
||
it('should return url is pjson.bugs is an object', () => { | ||
const pjson = { | ||
bugs: {url: 'https://github.com/oclif/plugin-plugins/issues'}, | ||
name: '@oclif/plugin-plugins', | ||
repository: { | ||
type: 'git', | ||
url: 'git+https://github.com/oclif/plugin-plugins.git', | ||
}, | ||
version: '1.0.0', | ||
} | ||
|
||
expect(extractIssuesLocation(pjson.bugs, pjson.repository)).to.equal(pjson.bugs.url) | ||
}) | ||
|
||
it('should return url if pjson.bugs is undefined and pjson.repository is a string', () => { | ||
const pjson = { | ||
name: '@oclif/plugin-plugins', | ||
repository: 'https://github.com/oclif/plugin-plugins.git', | ||
version: '1.0.0', | ||
} | ||
|
||
expect(extractIssuesLocation(undefined, pjson.repository)).to.equal(pjson.repository) | ||
}) | ||
|
||
it('should return url if pjson.bugs is undefined and pjson.repository is an object', () => { | ||
const pjson = { | ||
name: '@oclif/plugin-plugins', | ||
repository: { | ||
type: 'git', | ||
url: 'git+https://github.com/oclif/plugin-plugins.git', | ||
}, | ||
version: '1.0.0', | ||
} | ||
|
||
expect(extractIssuesLocation(undefined, pjson.repository)).to.equal('https://github.com/oclif/plugin-plugins') | ||
}) | ||
}) |