Skip to content

Commit

Permalink
🧪 test: replace 'test' with 'it' in all test files to align with Vite…
Browse files Browse the repository at this point in the history
…st conventions
  • Loading branch information
nyxb committed May 23, 2024
1 parent f778a68 commit 52ccf86
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 127 deletions.
22 changes: 11 additions & 11 deletions test/nyxa/bun.spec.ts
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 { parseNyxa } from '../../src/commands'

const agent = 'bun'
function _(arg: string, expected: string) {
return () => {
expect(
parseNyxa(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
return () => {
expect(
parseNyxa(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
}

test('empty', _('', 'bun'))
test('foo', _('foo', 'bun foo'))
test('run test', _('run test', 'bun run test'))
it('empty', _('', 'bun'))
it('foo', _('foo', 'bun foo'))
it('run test', _('run test', 'bun run test'))
22 changes: 11 additions & 11 deletions test/nyxa/npm.spec.ts
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 { parseNyxa } from '../../src/commands'

const agent = 'npm'
function _(arg: string, expected: string) {
return () => {
expect(
parseNyxa(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
return () => {
expect(
parseNyxa(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
}

test('empty', _('', 'npm'))
test('foo', _('foo', 'npm foo'))
test('run test', _('run test', 'npm run test'))
it('empty', _('', 'npm'))
it('foo', _('foo', 'npm foo'))
it('run test', _('run test', 'npm run test'))
22 changes: 11 additions & 11 deletions test/nyxa/pnpm.spec.ts
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 { parseNyxa } from '../../src/commands'

const agent = 'pnpm'
function _(arg: string, expected: string) {
return () => {
expect(
parseNyxa(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
return () => {
expect(
parseNyxa(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
}

test('empty', _('', 'pnpm'))
test('foo', _('foo', 'pnpm foo'))
test('run test', _('run test', 'pnpm run test'))
it('empty', _('', 'pnpm'))
it('foo', _('foo', 'pnpm foo'))
it('run test', _('run test', 'pnpm run test'))
22 changes: 11 additions & 11 deletions test/nyxa/yarn.spec.ts
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 { parseNyxa } from '../../src/commands'

const agent = 'yarn'
function _(arg: string, expected: string) {
return () => {
expect(
parseNyxa(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
return () => {
expect(
parseNyxa(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
}

test('empty', _('', 'yarn'))
test('foo', _('foo', 'yarn foo'))
test('run test', _('run test', 'yarn run test'))
it('empty', _('', 'yarn'))
it('foo', _('foo', 'yarn foo'))
it('run test', _('run test', 'yarn run test'))
22 changes: 11 additions & 11 deletions test/nyxa/[email protected]
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 { parseNyxa } from '../../src/commands'

const agent = 'yarn@berry'
function _(arg: string, expected: string) {
return () => {
expect(
parseNyxa(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
return () => {
expect(
parseNyxa(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
}

test('empty', _('', 'yarn'))
test('foo', _('foo', 'yarn foo'))
test('run test', _('run test', 'yarn run test'))
it('empty', _('', 'yarn'))
it('foo', _('foo', 'yarn foo'))
it('run test', _('run test', 'yarn run test'))
28 changes: 14 additions & 14 deletions test/nyxi/bun.spec.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { expect, test } from 'vitest'
import { expect, it } from 'vitest'
import { parseNyxi } from '../../src/commands'

const agent = 'bun'
function _(arg: string, expected: string) {
return () => {
expect(
parseNyxi(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
return () => {
expect(
parseNyxi(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
}

test('empty', _('', 'bun install'))
it('empty', _('', 'bun install'))

test('single add', _('axios', 'bun add axios'))
it('single add', _('axios', 'bun add axios'))

test('add dev', _('vite -D', 'bun add vite -d'))
it('add dev', _('vite -D', 'bun add vite -d'))

test('multiple', _('eslint @types/node', 'bun add eslint @types/node'))
it('multiple', _('eslint @types/node', 'bun add eslint @types/node'))

test('global', _('eslint -g', 'bun add -g eslint'))
it('global', _('eslint -g', 'bun add -g eslint'))

test('frozen', _('--frozen', 'bun install --no-save'))
it('frozen', _('--frozen', 'bun install --no-save'))
28 changes: 14 additions & 14 deletions test/nyxi/npm.spec.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { expect, test } from 'vitest'
import { expect, it } from 'vitest'
import { parseNyxi } from '../../src/commands'

const agent = 'npm'
function _(arg: string, expected: string) {
return () => {
expect(
parseNyxi(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
return () => {
expect(
parseNyxi(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
}

test('empty', _('', 'npm i'))
it('empty', _('', 'npm i'))

test('single add', _('axios', 'npm i axios'))
it('single add', _('axios', 'npm i axios'))

test('multiple', _('eslint @types/node', 'npm i eslint @types/node'))
it('multiple', _('eslint @types/node', 'npm i eslint @types/node'))

test('-D', _('eslint @types/node -D', 'npm i eslint @types/node -D'))
it('-D', _('eslint @types/node -D', 'npm i eslint @types/node -D'))

test('global', _('eslint -g', 'npm i -g eslint'))
it('global', _('eslint -g', 'npm i -g eslint'))

test('frozen', _('--frozen', 'npm ci'))
it('frozen', _('--frozen', 'npm ci'))
32 changes: 16 additions & 16 deletions test/nyxi/pnpm.spec.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { expect, test } from 'vitest'
import { expect, it } from 'vitest'
import { parseNyxi } from '../../src/commands'

const agent = 'pnpm'
function _(arg: string, expected: string) {
return () => {
expect(
parseNyxi(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
return () => {
expect(
parseNyxi(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
}

test('empty', _('', 'pnpm i'))
it('empty', _('', 'pnpm i'))

test('single add', _('axios', 'pnpm add axios'))
it('single add', _('axios', 'pnpm add axios'))

test('multiple', _('eslint @types/node', 'pnpm add eslint @types/node'))
it('multiple', _('eslint @types/node', 'pnpm add eslint @types/node'))

test('-D', _('-D eslint @types/node', 'pnpm add -D eslint @types/node'))
it('-D', _('-D eslint @types/node', 'pnpm add -D eslint @types/node'))

test('global', _('eslint -g', 'pnpm add -g eslint'))
it('global', _('eslint -g', 'pnpm add -g eslint'))

test('frozen', _('--frozen', 'pnpm i --frozen-lockfile'))
it('frozen', _('--frozen', 'pnpm i --frozen-lockfile'))

test('forward1', _('--anything', 'pnpm i --anything'))
test('forward2', _('-a', 'pnpm i -a'))
it('forward1', _('--anything', 'pnpm i --anything'))
it('forward2', _('-a', 'pnpm i -a'))
28 changes: 14 additions & 14 deletions test/nyxi/yarn.spec.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { expect, test } from 'vitest'
import { expect, it } from 'vitest'
import { parseNyxi } from '../../src/commands'

const agent = 'yarn'
function _(arg: string, expected: string) {
return () => {
expect(
parseNyxi(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
return () => {
expect(
parseNyxi(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
}

test('empty', _('', 'yarn install'))
it('empty', _('', 'yarn install'))

test('single add', _('axios', 'yarn add axios'))
it('single add', _('axios', 'yarn add axios'))

test('multiple', _('eslint @types/node', 'yarn add eslint @types/node'))
it('multiple', _('eslint @types/node', 'yarn add eslint @types/node'))

test('-D', _('eslint @types/node -D', 'yarn add eslint @types/node -D'))
it('-D', _('eslint @types/node -D', 'yarn add eslint @types/node -D'))

test('global', _('eslint nyxi -g', 'yarn global add eslint nyxi'))
it('global', _('eslint nyxi -g', 'yarn global add eslint nyxi'))

test('frozen', _('--frozen', 'yarn install --frozen-lockfile'))
it('frozen', _('--frozen', 'yarn install --frozen-lockfile'))
28 changes: 14 additions & 14 deletions test/nyxr/[email protected]
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { expect, test } from 'vitest'
import { parseNr } from '../../src/commands'
import { expect, it } from 'vitest'
import { parseNyxr } from '../../src/commands'

const agent = 'yarn@berry'
function _(arg: string, expected: string) {
return () => {
expect(
parseNr(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
return () => {
expect(
parseNyxr(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}
}

test('empty', _('', 'yarn run start'))
it('empty', _('', 'yarn run start'))

test('if-present', _('test --if-present', 'yarn run --if-present test'))
it('if-present', _('test --if-present', 'yarn run --if-present test'))

test('script', _('dev', 'yarn run dev'))
it('script', _('dev', 'yarn run dev'))

test('script with arguments', _('build --watch -o', 'yarn run build --watch -o'))
it('script with arguments', _('build --watch -o', 'yarn run build --watch -o'))

test('colon', _('build:dev', 'yarn run build:dev'))
it('colon', _('build:dev', 'yarn run build:dev'))

0 comments on commit 52ccf86

Please sign in to comment.