fix(CLI): allow scoped npm package names
switch to npm's validate-npm-package-name internally Fixes #68
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
||||
install,
|
||||
Placeholders
|
||||
} from '../tasks';
|
||||
import { getIntro, Runner } from '../utils';
|
||||
import { getIntro, Runner, validateName } from '../utils';
|
||||
|
||||
test('errors if outdated', async t => {
|
||||
nock.disableNetConnect();
|
||||
@@ -101,6 +101,12 @@ test('checkArgs always returns { install } (so --no-install works in interactive
|
||||
t.deepEqual(opts, { install: true });
|
||||
});
|
||||
|
||||
test('only accepts valid package names', async t => {
|
||||
t.true(validateName('package-name'));
|
||||
t.true(validateName('package-name-2'));
|
||||
t.true(validateName('@example/package-name-2'));
|
||||
});
|
||||
|
||||
test('ascii art shows if stdout has 85+ columns', async t => {
|
||||
const jumbo = getIntro(100);
|
||||
const snippet = `| __| | | | '_ \\ / _ \\/ __|/ __| '__| | '_ \\|`;
|
||||
|
||||
Reference in New Issue
Block a user