Skip to content

Commit fd2d046

Browse files
authored
tests: adds initial tests for fullstack app and a Postgres repository (#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]>
1 parent 38bc4d1 commit fd2d046

16 files changed

+3193
-597
lines changed

Diff for: .github/workflows/check_fullstack_demo_ts_pr.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
with:
2323
node-version: '20.x'
2424

25-
- name: Build Fullstack Demo with Node.js
25+
- name: Test Fullstack Demo with Node.js
2626
working-directory: ./lib/javascript/fullstack_demo
2727
env:
2828
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}
2929
run: |
3030
npm ci
31-
npm run build
31+
npm run test

Diff for: .github/workflows/check_push.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ jobs:
159159
CLERK_SECRET_KEY: 12345
160160
run: ./gradlew check
161161

162-
- name: Build Fullstack Demo with Node.js
162+
- name: Test Fullstack Demo with Node.js
163163
working-directory: ./lib/javascript/fullstack_demo
164164
env:
165165
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}
166166
run: |
167167
npm ci
168-
npm run build
168+
npm run test

Diff for: lib/javascript/fullstack_demo/.env.example

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=Your Next Public Clerk Publishable Key here
22
CLERK_SECRET_KEY=Your Clerk Secret Key here
3-
DB_TYPE=in-memory
3+
DB_TYPE=in-memory
4+
NEXT_PUBLIC_API_URL=http://localhost:3000

Diff for: lib/javascript/fullstack_demo/.env.example.postgres

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=Your Next Public Clerk Publishable Key here
2+
CLERK_SECRET_KEY=Your Clerk Secret Key here
3+
DB_TYPE=postgres
4+
NEXT_PUBLIC_API_URL=http://localhost:3000
5+
DATABASE_URL=Your Postgres connection pooling database URL
6+
DIRECT_URL=Your Postgres direct database URL

Diff for: lib/javascript/fullstack_demo/.env.test

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_someKey
2+
CLERK_SECRET_KEY=sk_test_anotherKey
3+
DB_TYPE=in-memory
4+
NEXT_PUBLIC_API_URL=http://localhost:3000

Diff for: lib/javascript/fullstack_demo/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ yarn-error.log*
3333
.env*
3434
!.env.example
3535
!.env.example.*
36+
!.env.test
37+
!.env.test.*
3638

3739
# vercel
3840
.vercel

Diff for: lib/javascript/fullstack_demo/global.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import 'vitest-fetch-mock';

0 commit comments

Comments
 (0)