-
-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Anthony Fu <[email protected]>
- Loading branch information
Showing
9 changed files
with
108 additions
and
3 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,3 @@ | ||
#!/usr/bin/env node | ||
'use strict' | ||
require('../dist/nrm') |
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
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,4 @@ | ||
import { parseNrm } from './commands' | ||
import { runCli } from './runner' | ||
|
||
runCli(parseNrm) |
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,18 @@ | ||
import test, { ExecutionContext } from 'ava' | ||
import { parseNrm } from '../../src/commands' | ||
|
||
const agent = 'npm' | ||
const _ = (arg: string, expected: string) => (t: ExecutionContext) => { | ||
t.is( | ||
parseNrm(agent, arg.split(' ').filter(Boolean)), | ||
expected, | ||
) | ||
} | ||
|
||
test('single remove', _('axios', 'npm uninstall axios')) | ||
|
||
test('multiple', _('eslint @types/node', 'npm uninstall eslint @types/node')) | ||
|
||
test('-D', _('eslint @types/node -D', 'npm uninstall eslint @types/node -D')) | ||
|
||
test('global', _('eslint -g', 'npm uninstall -g eslint')) |
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,18 @@ | ||
import test, { ExecutionContext } from 'ava' | ||
import { parseNrm } from '../../src/commands' | ||
|
||
const agent = 'pnpm' | ||
const _ = (arg: string, expected: string) => (t: ExecutionContext) => { | ||
t.is( | ||
parseNrm(agent, arg.split(' ').filter(Boolean)), | ||
expected, | ||
) | ||
} | ||
|
||
test('single remove', _('axios', 'pnpm remove axios')) | ||
|
||
test('multiple', _('eslint @types/node', 'pnpm remove eslint @types/node')) | ||
|
||
test('-D', _('eslint @types/node -D', 'pnpm remove eslint @types/node -D')) | ||
|
||
test('global', _('eslint -g', 'pnpm remove -g eslint')) |
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,18 @@ | ||
import test, { ExecutionContext } from 'ava' | ||
import { parseNrm } from '../../src/commands' | ||
|
||
const agent = 'yarn' | ||
const _ = (arg: string, expected: string) => (t: ExecutionContext) => { | ||
t.is( | ||
parseNrm(agent, arg.split(' ').filter(Boolean)), | ||
expected, | ||
) | ||
} | ||
|
||
test('single remove', _('axios', 'yarn remove axios')) | ||
|
||
test('multiple', _('eslint @types/node', 'yarn remove eslint @types/node')) | ||
|
||
test('-D', _('eslint @types/node -D', 'yarn remove eslint @types/node -D')) | ||
|
||
test('global', _('eslint ni -g', 'yarn global remove eslint ni')) |