-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📦 build(eslint.config.mjs): add new ESLint configuration file to stan…
…dardize code style 🧪 test(*.spec.ts): replace 'test' with 'it' for consistency with Vitest conventions in all test files
- Loading branch information
Showing
10 changed files
with
110 additions
and
100 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,10 @@ | ||
import nyxb from '@nyxb/eslint-config' | ||
|
||
export default nyxb({ | ||
formatters: true, | ||
react: true, | ||
|
||
rules: { | ||
'no-console': 0, | ||
}, | ||
}) |
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { expect, test } from 'vitest' | ||
import { expect, it } from 'vitest' | ||
import { parseNyxu } from '../../src/commands' | ||
|
||
const agent = 'npm' | ||
function _(arg: string, expected: string) { | ||
return () => { | ||
expect( | ||
parseNyxu(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
return () => { | ||
expect( | ||
parseNyxu(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
} | ||
|
||
test('empty', _('', 'npm update')) | ||
it('empty', _('', 'npm update')) |
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import { expect, test } from 'vitest' | ||
import { expect, it } from 'vitest' | ||
import { parseNyxu } from '../../src/commands' | ||
|
||
const agent = 'pnpm' | ||
function _(arg: string, expected: string) { | ||
return () => { | ||
expect( | ||
parseNyxu(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
return () => { | ||
expect( | ||
parseNyxu(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
} | ||
|
||
test('empty', _('', 'pnpm update')) | ||
it('empty', _('', 'pnpm update')) | ||
|
||
test('interactive', _('-i', 'pnpm update -i')) | ||
it('interactive', _('-i', 'pnpm update -i')) | ||
|
||
test('interactive latest', _('-i --latest', 'pnpm update -i --latest')) | ||
it('interactive latest', _('-i --latest', 'pnpm update -i --latest')) |
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import { expect, test } from 'vitest' | ||
import { expect, it } from 'vitest' | ||
import { parseNyxu } from '../../src/commands' | ||
|
||
const agent = 'yarn' | ||
function _(arg: string, expected: string) { | ||
return () => { | ||
expect( | ||
parseNyxu(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
return () => { | ||
expect( | ||
parseNyxu(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
} | ||
|
||
test('empty', _('', 'yarn upgrade')) | ||
it('empty', _('', 'yarn upgrade')) | ||
|
||
test('interactive', _('-i', 'yarn upgrade-interactive')) | ||
it('interactive', _('-i', 'yarn upgrade-interactive')) | ||
|
||
test('interactive latest', _('-i --latest', 'yarn upgrade-interactive --latest')) | ||
it('interactive latest', _('-i --latest', 'yarn upgrade-interactive --latest')) |
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import { expect, test } from 'vitest' | ||
import { expect, it } from 'vitest' | ||
import { parseNyxu } from '../../src/commands' | ||
|
||
const agent = 'yarn@berry' | ||
function _(arg: string, expected: string) { | ||
return () => { | ||
expect( | ||
parseNyxu(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
return () => { | ||
expect( | ||
parseNyxu(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
} | ||
|
||
test('empty', _('', 'yarn up')) | ||
it('empty', _('', 'yarn up')) | ||
|
||
test('interactive', _('-i', 'yarn up -i')) | ||
it('interactive', _('-i', 'yarn up -i')) |
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import { expect, test } from 'vitest' | ||
import { expect, it } from 'vitest' | ||
import { parseNyxun } from '../../src/commands' | ||
|
||
const agent = 'bun' | ||
function _(arg: string, expected: string) { | ||
return () => { | ||
expect( | ||
parseNyxun(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
return () => { | ||
expect( | ||
parseNyxun(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
} | ||
|
||
test('single uninstall', _('axios', 'bun remove axios')) | ||
it('single uninstall', _('axios', 'bun remove axios')) | ||
|
||
test('multiple', _('eslint @types/node', 'bun remove eslint @types/node')) | ||
it('multiple', _('eslint @types/node', 'bun remove eslint @types/node')) | ||
|
||
test('global', _('eslint nyxi -g', 'bun remove -g eslint nyxi')) | ||
it('global', _('eslint nyxi -g', 'bun remove -g eslint nyxi')) |
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import { expect, test } from 'vitest' | ||
import { expect, it } from 'vitest' | ||
import { parseNyxun } from '../../src/commands' | ||
|
||
const agent = 'npm' | ||
function _(arg: string, expected: string) { | ||
return () => { | ||
expect( | ||
parseNyxun(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
return () => { | ||
expect( | ||
parseNyxun(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
} | ||
|
||
test('single uninstall', _('axios', 'npm uninstall axios')) | ||
it('single uninstall', _('axios', 'npm uninstall axios')) | ||
|
||
test('multiple', _('eslint @types/node', 'npm uninstall eslint @types/node')) | ||
it('multiple', _('eslint @types/node', 'npm uninstall eslint @types/node')) | ||
|
||
test('-D', _('eslint @types/node -D', 'npm uninstall eslint @types/node -D')) | ||
it('-D', _('eslint @types/node -D', 'npm uninstall eslint @types/node -D')) | ||
|
||
test('global', _('eslint -g', 'npm uninstall -g eslint')) | ||
it('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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import { expect, test } from 'vitest' | ||
import { expect, it } from 'vitest' | ||
import { parseNyxun } from '../../src/commands' | ||
|
||
const agent = 'pnpm' | ||
function _(arg: string, expected: string) { | ||
return () => { | ||
expect( | ||
parseNyxun(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
return () => { | ||
expect( | ||
parseNyxun(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
} | ||
|
||
test('single add', _('axios', 'pnpm remove axios')) | ||
it('single add', _('axios', 'pnpm remove axios')) | ||
|
||
test('multiple', _('eslint @types/node', 'pnpm remove eslint @types/node')) | ||
it('multiple', _('eslint @types/node', 'pnpm remove eslint @types/node')) | ||
|
||
test('-D', _('-D eslint @types/node', 'pnpm remove -D eslint @types/node')) | ||
it('-D', _('-D eslint @types/node', 'pnpm remove -D eslint @types/node')) | ||
|
||
test('global', _('eslint -g', 'pnpm remove --global eslint')) | ||
it('global', _('eslint -g', 'pnpm remove --global 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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import { expect, test } from 'vitest' | ||
import { expect, it } from 'vitest' | ||
import { parseNyxun } from '../../src/commands' | ||
|
||
const agent = 'yarn' | ||
function _(arg: string, expected: string) { | ||
return () => { | ||
expect( | ||
parseNyxun(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
return () => { | ||
expect( | ||
parseNyxun(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
} | ||
|
||
test('single uninstall', _('axios', 'yarn remove axios')) | ||
it('single uninstall', _('axios', 'yarn remove axios')) | ||
|
||
test('multiple', _('eslint @types/node', 'yarn remove eslint @types/node')) | ||
it('multiple', _('eslint @types/node', 'yarn remove eslint @types/node')) | ||
|
||
test('-D', _('eslint @types/node -D', 'yarn remove eslint @types/node -D')) | ||
it('-D', _('eslint @types/node -D', 'yarn remove eslint @types/node -D')) | ||
|
||
test('global', _('eslint nyxi -g', 'yarn global remove eslint nyxi')) | ||
it('global', _('eslint nyxi -g', 'yarn global remove eslint nyxi')) |
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import { expect, test } from 'vitest' | ||
import { expect, it } from 'vitest' | ||
import { parseNyxun } from '../../src/commands' | ||
|
||
const agent = 'yarn@berry' | ||
function _(arg: string, expected: string) { | ||
return () => { | ||
expect( | ||
parseNyxun(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
return () => { | ||
expect( | ||
parseNyxun(agent, arg.split(' ').filter(Boolean)), | ||
).toBe( | ||
expected, | ||
) | ||
} | ||
} | ||
|
||
test('single add', _('axios', 'yarn remove axios')) | ||
it('single add', _('axios', 'yarn remove axios')) | ||
|
||
test('multiple', _('eslint @types/node', 'yarn remove eslint @types/node')) | ||
it('multiple', _('eslint @types/node', 'yarn remove eslint @types/node')) | ||
|
||
test('-D', _('eslint @types/node -D', 'yarn remove eslint @types/node -D')) | ||
it('-D', _('eslint @types/node -D', 'yarn remove eslint @types/node -D')) | ||
|
||
test('global', _('eslint nyxi -g', 'npm uninstall -g eslint nyxi')) | ||
it('global', _('eslint nyxi -g', 'npm uninstall -g eslint nyxi')) |