Skip to content

Commit

Permalink
chore: add initial cli tests (#604)
Browse files Browse the repository at this point in the history
Co-authored-by: AdrianGonz97 <[email protected]>
  • Loading branch information
huntabyte and AdrianGonz97 authored Jan 5, 2024
1 parent 769b578 commit fd16c04
Show file tree
Hide file tree
Showing 32 changed files with 1,763 additions and 19 deletions.
33 changes: 32 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,35 @@ jobs:
- name: Install dependencies
run: pnpm install

- run: pnpm lint
- run: pnpm lint

cli-test:
name: CLI-Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18

# PNPM Store cache setup
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Run tests
run: pnpm -F shadcn-svelte test
7 changes: 5 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"pub:beta": "pnpm build && pnpm publish --no-git-checks --access public --tag beta",
"pub:next": "pnpm build && pnpm publish --no-git-checks --access public --tag next",
"pub:release": "pnpm build && pnpm publish --access public",
"temp": "pnpm build && pnpm start config"
"temp": "pnpm build && pnpm start config",
"test": "vitest"
},
"dependencies": {
"chalk": "5.2.0",
Expand All @@ -63,6 +64,7 @@
"@ianvs/prettier-plugin-sort-imports": "^3.7.2",
"@types/estree": "^1.0.1",
"@types/fs-extra": "^11.0.1",
"@types/node": "^18.17.5",
"@types/prettier": "^2.7.2",
"@types/prompts": "^2.4.2",
"acorn": "^8.8.2",
Expand All @@ -74,6 +76,7 @@
"rimraf": "^4.1.3",
"tsup": "^6.6.3",
"type-fest": "^3.8.0",
"typescript": "^4.9.3"
"typescript": "^4.9.3",
"vitest": "^0.34.1"
}
}
Loading

0 comments on commit fd16c04

Please sign in to comment.