-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from deinsoftware/dev
test: 🧪 command and alias e2e test
- Loading branch information
Showing
71 changed files
with
707 additions
and
221 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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
node_modules/ | ||
types/ | ||
**/*.types.* | ||
**/*.map.* | ||
build/ | ||
swpm*.tgz | ||
tsconfig.build.tsbuildinfo |
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
"CHEATSHEET", | ||
"cmdr", | ||
"cmds", | ||
"Codeium", | ||
"dein", | ||
"deinsoftware", | ||
"Dsonar", | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,10 @@ | ||
import { it, expect, describe } from 'vitest' | ||
import { testCommandResult } from '../../.vitest/helpers' | ||
import { addCases } from '../cli/swpm/commands/add.test' | ||
|
||
describe('sa', () => { | ||
it.each(addCases)('%s', (pkg, expected) => { | ||
const result = testCommandResult(`sa vite --test ${pkg}`) | ||
expect(result).toBe(expected) | ||
}) | ||
}) |
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 { it, expect, describe } from 'vitest' | ||
import { testCommandResult } from '../../.vitest/helpers' | ||
import { addDevCases } from '../cli/swpm/commands/add.test' | ||
|
||
describe('sad', () => { | ||
it.each(addDevCases)('%s', (pkg, expected) => { | ||
const result = testCommandResult(`sad vite --test ${pkg}`) | ||
expect(result).toBe(expected) | ||
}) | ||
}) |
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 { it, expect, describe } from 'vitest' | ||
import { testCommandResult } from '../../.vitest/helpers' | ||
|
||
describe('sade', () => { | ||
it.each([ | ||
['npm', 'npm add vite --save-dev --save-exact'], | ||
['yarn', 'yarn add vite --dev --exact'], | ||
['yarn@berry', 'yarn add vite --dev --exact'], | ||
['pnpm', 'pnpm add vite --save-dev --save-exact'], | ||
['bun', 'bun add vite --dev --exact'] | ||
])('%s', (pkg, expected) => { | ||
const result = testCommandResult(`sade vite --test ${pkg}`) | ||
expect(result).toBe(expected) | ||
}) | ||
}) |
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 { it, expect, describe } from 'vitest' | ||
import { testCommandResult } from '../../.vitest/helpers' | ||
import { addSaveExact } from '../cli/swpm/commands/add.test' | ||
|
||
describe('sae', () => { | ||
it.each(addSaveExact)('%s', (pkg, expected) => { | ||
const result = testCommandResult(`sae vite --test ${pkg}`) | ||
expect(result).toBe(expected) | ||
}) | ||
}) |
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,12 @@ | ||
import { it, expect, describe } from 'vitest' | ||
import { testCommandResult } from '../../.vitest/helpers' | ||
import { addPackageCases, addVoltaCases } from '../cli/swpm/commands/add.test' | ||
|
||
const voltaVersion = testCommandResult('volta --version') | ||
|
||
describe('sag', () => { | ||
it.each(voltaVersion ? addVoltaCases : addPackageCases)('%s', (pkg, expected) => { | ||
const result = testCommandResult(`sag vite --test ${pkg}`) | ||
expect(result).toBe(expected) | ||
}) | ||
}) |
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,24 @@ | ||
import { it, expect, describe } from 'vitest' | ||
import { testCommandResult } from '../../.vitest/helpers' | ||
import { installCases, installFrozenCases, installLockCases } from '../cli/swpm/commands/install.test' | ||
|
||
describe('si', () => { | ||
it.each(installCases)('%s', (pkg, expected) => { | ||
const result = testCommandResult(`si --test ${pkg}`) | ||
expect(result).toBe(expected) | ||
}) | ||
}) | ||
|
||
describe('si --frozen', () => { | ||
it.each(installFrozenCases)('%s', (pkg, expected) => { | ||
const result = testCommandResult(`si --frozen --test ${pkg}`) | ||
expect(result).toBe(expected) | ||
}) | ||
}) | ||
|
||
describe('si --package-lock', () => { | ||
it.each(installLockCases)('%s', (pkg, expected) => { | ||
const result = testCommandResult(`si --package-lock --test ${pkg}`) | ||
expect(result).toBe(expected) | ||
}) | ||
}) |
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 { it, expect, describe } from 'vitest' | ||
import { testCommandResult } from '../../.vitest/helpers' | ||
import { installFrozenCases } from '../cli/swpm/commands/install.test' | ||
|
||
describe('sif', () => { | ||
it.each(installFrozenCases)('%s', (pkg, expected) => { | ||
const result = testCommandResult(`sif --test ${pkg}`) | ||
expect(result).toBe(expected) | ||
}) | ||
}) |
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 { it, expect, describe } from 'vitest' | ||
import { testCommandResult } from '../../.vitest/helpers' | ||
|
||
describe('sr', () => { | ||
it.each([ | ||
['npm', 'npm run dev -- --port 3030'], | ||
['yarn', 'yarn run dev --port 3030'], | ||
['yarn@berry', 'yarn run dev --port 3030'], | ||
['pnpm', 'pnpm run dev --port 3030'], | ||
['bun', 'bun run dev --port 3030'] | ||
])('%s', (pkg, expected) => { | ||
const result = testCommandResult(`sr dev --port 3030 --test ${pkg}`) | ||
expect(result).toBe(expected) | ||
}) | ||
}) |
Oops, something went wrong.