-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(owner): Fix the currently broken
yarn owner
command (#5593)
**Summary** * fixing currently broken owner command * doesn't ask for npm username and password for list command * adding basic test #3893 **Test plan** Yarn now correctly displays the list of package owners. Also added automated tests.
- Loading branch information
Showing
5 changed files
with
41 additions
and
10 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,8 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`list should show owners 1`] = ` | ||
"{\\"type\\":\\"warning\\",\\"data\\":\\"package.json: No license field\\"} | ||
{\\"type\\":\\"step\\",\\"data\\":{\\"message\\":\\"Getting owners for package \\\\\\"yarn\\\\\\"\\",\\"current\\":1,\\"total\\":1}} | ||
{\\"type\\":\\"info\\",\\"data\\":\\"daniel15 <[email protected]>\\"} | ||
" | ||
`; |
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,26 @@ | ||
/* @flow */ | ||
|
||
import {JSONReporter} from '../../src/reporters/index.js'; | ||
import {run as buildRun} from './_helpers.js'; | ||
import {run as owner} from '../../src/cli/commands/owner.js'; | ||
|
||
const path = require('path'); | ||
|
||
const fixturesLoc = path.join(__dirname, '..', 'fixtures', 'owner'); | ||
|
||
const runOwner = buildRun.bind( | ||
null, | ||
JSONReporter, | ||
fixturesLoc, | ||
async (args, flags, config, reporter, lockfile, getStdout): Promise<string> => { | ||
reporter.disableProgress(); | ||
await owner(config, reporter, flags, args); | ||
return getStdout(); | ||
}, | ||
); | ||
|
||
test('list should show owners', async (): Promise<void> => { | ||
await runOwner(['list', 'yarn'], {nonInteractive: true}, '', (config, reporter, stdout) => { | ||
expect(stdout).toMatchSnapshot(); | ||
}); | ||
}); |
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,3 @@ | ||
{ | ||
"name": "yarn" | ||
} |
Binary file modified
BIN
+74 Bytes
(100%)
__tests__/fixtures/request-cache/GET/registry.yarnpkg.com/angular/core/-/core-2.4.10.tgz.bin
Binary file not shown.
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