-
-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
82 additions
and
1 deletion.
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/na') |
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 { parseNa } from './commands' | ||
import { runCli } from './runner' | ||
|
||
runCli(parseNa) |
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,15 @@ | ||
import { expect, test } from 'vitest' | ||
import { parseNa } from '../../src/commands' | ||
|
||
const agent = 'npm' | ||
const _ = (arg: string, expected: string) => () => { | ||
expect( | ||
parseNa(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
|
||
test('empty', _('', 'npm')) | ||
test('foo', _('foo', 'npm foo')) | ||
test('run test', _('run test', 'npm run test')) |
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,15 @@ | ||
import { expect, test } from 'vitest' | ||
import { parseNa } from '../../src/commands' | ||
|
||
const agent = 'pnpm' | ||
const _ = (arg: string, expected: string) => () => { | ||
expect( | ||
parseNa(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
|
||
test('empty', _('', 'pnpm')) | ||
test('foo', _('foo', 'pnpm foo')) | ||
test('run test', _('run test', 'pnpm run test')) |
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,15 @@ | ||
import { expect, test } from 'vitest' | ||
import { parseNa } from '../../src/commands' | ||
|
||
const agent = 'yarn' | ||
const _ = (arg: string, expected: string) => () => { | ||
expect( | ||
parseNa(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
|
||
test('empty', _('', 'yarn')) | ||
test('foo', _('foo', 'yarn foo')) | ||
test('run test', _('run test', 'yarn run test')) |