Skip to content

Commit

Permalink
tests: adds initial tests for fullstack app and a Postgres repository (
Browse files Browse the repository at this point in the history
…#706)

* tests: adds first component test

Signed-off-by: Anthony D. Mays <[email protected]>

* chore: adds .env.test

* feat: adds postgres repo

* chore: updates config to use postgres direct & pooling connections

* chore: updates build action

Signed-off-by: Anthony D. Mays <[email protected]>

* fix: uses correct user_id for queries

---------

Signed-off-by: Anthony D. Mays <[email protected]>
  • Loading branch information
anthonydmays authored Jan 3, 2025
1 parent 38bc4d1 commit fd2d046
Show file tree
Hide file tree
Showing 16 changed files with 3,193 additions and 597 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check_fullstack_demo_ts_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
with:
node-version: '20.x'

- name: Build Fullstack Demo with Node.js
- name: Test Fullstack Demo with Node.js
working-directory: ./lib/javascript/fullstack_demo
env:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}
run: |
npm ci
npm run build
npm run test
4 changes: 2 additions & 2 deletions .github/workflows/check_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ jobs:
CLERK_SECRET_KEY: 12345
run: ./gradlew check

- name: Build Fullstack Demo with Node.js
- name: Test Fullstack Demo with Node.js
working-directory: ./lib/javascript/fullstack_demo
env:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}
run: |
npm ci
npm run build
npm run test
3 changes: 2 additions & 1 deletion lib/javascript/fullstack_demo/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=Your Next Public Clerk Publishable Key here
CLERK_SECRET_KEY=Your Clerk Secret Key here
DB_TYPE=in-memory
DB_TYPE=in-memory
NEXT_PUBLIC_API_URL=http://localhost:3000
6 changes: 6 additions & 0 deletions lib/javascript/fullstack_demo/.env.example.postgres
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=Your Next Public Clerk Publishable Key here
CLERK_SECRET_KEY=Your Clerk Secret Key here
DB_TYPE=postgres
NEXT_PUBLIC_API_URL=http://localhost:3000
DATABASE_URL=Your Postgres connection pooling database URL
DIRECT_URL=Your Postgres direct database URL
4 changes: 4 additions & 0 deletions lib/javascript/fullstack_demo/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_someKey
CLERK_SECRET_KEY=sk_test_anotherKey
DB_TYPE=in-memory
NEXT_PUBLIC_API_URL=http://localhost:3000
2 changes: 2 additions & 0 deletions lib/javascript/fullstack_demo/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ yarn-error.log*
.env*
!.env.example
!.env.example.*
!.env.test
!.env.test.*

# vercel
.vercel
Expand Down
1 change: 1 addition & 0 deletions lib/javascript/fullstack_demo/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'vitest-fetch-mock';
Loading

0 comments on commit fd2d046

Please sign in to comment.