Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9535f4a
Refactor Prisma schema to enhance article and user relationships by i…
yamcodes Jul 1, 2025
b5d24fe
Refactor profiles plugin to streamline follow functionality by replac…
yamcodes Jul 1, 2025
a25a393
Refactor comments plugin to enhance user follow functionality by upda…
yamcodes Jul 1, 2025
2a9079f
Refactor articles plugin to update user relationship handling by rena…
yamcodes Jul 1, 2025
0c15c36
Refactor articles plugin to rename favorites to favoritedBy across th…
yamcodes Jul 1, 2025
7178a22
Refactor articles plugin to rename the favorites property to favorite…
yamcodes Jul 1, 2025
0e453c8
Update dependencies and improve test scripts by adding @elysiajs/eden…
yamcodes Jul 1, 2025
024a763
Merge branch 'main' into eden-treaty-tests
yamcodes Jul 1, 2025
1bcef38
Merge branch 'main' into eden-treaty-tests
yamcodes Jul 1, 2025
0fe2aa3
Implement code changes to enhance functionality and improve performance
yamcodes Jul 2, 2025
01f39bf
Fix Eden Treaty tests
yamcodes Jul 2, 2025
ba053de
Update test scripts and package.json for improved functionality
yamcodes Jul 2, 2025
10b100f
Add comprehensive error handling tests for user registration, login, …
yamcodes Jul 2, 2025
5448d63
Refactor test scripts and update package.json for improved clarity an…
yamcodes Jul 4, 2025
89383a3
Refactor test command and enhance API tests for user authentication
yamcodes Jul 4, 2025
d991cc0
Remove unused utility functions and test files to streamline the code…
yamcodes Jul 4, 2025
6aaa94b
Refactor test imports and enhance user authentication tests
yamcodes Jul 4, 2025
8284288
Remove unused test utility imports in profiles test file
yamcodes Jul 4, 2025
4e36633
Update docker-compose and package.json for development and testing en…
yamcodes Jul 4, 2025
5984739
Merge branch 'main' of https://github.com/bedtime-coders/bepstack int…
yamcodes Jul 4, 2025
7c687e0
Add logging for database reset in resetDb utility function
yamcodes Jul 4, 2025
1be1287
Update docker-compose.yml to include newline at end of file for consi…
yamcodes Jul 4, 2025
0cebc2d
Remove authentication requirement from CreateArticle endpoint in arti…
yamcodes Jul 4, 2025
d408517
Remove unused test utility file to streamline the codebase
yamcodes Jul 4, 2025
9741d7b
Update DELAY_REQUEST configuration to use environment variable instea…
yamcodes Jul 4, 2025
5d3b0b2
Update environment configuration for testing by adding DB_TEST_PORT v…
yamcodes Jul 4, 2025
bee2bd5
Update db:down command in package.json to use 'docker compose rm -sf'…
yamcodes Jul 4, 2025
717df12
Refactor database removal commands in package.json to use 'docker com…
yamcodes Jul 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.test.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
POSTMAN_COLLECTION=./scripts/test/Conduit.postman_collection.json
DB_TEST_PORT=5433
14 changes: 13 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
services:
db:
db-dev:
image: postgres:17-alpine
restart: unless-stopped
environment:
Expand All @@ -10,6 +10,18 @@ services:
- "${DB_PORT:-5432}:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
db-test:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_USER: yam
POSTGRES_PASSWORD: yam123
POSTGRES_DB: bedstack_test
ports:
- "${DB_TEST_PORT:-5433}:5432"
volumes:
- postgres-test-data:/var/lib/postgresql/data

volumes:
postgres-data:
postgres-test-data:
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@
"db:migrate": "prisma migrate dev",
"db:reset": "prisma migrate reset",
"db:status": "prisma migrate status",
"db:start": "docker compose up -d",
"db:stop": "docker compose stop",
"db:restart": "docker compose restart",
"db:down": "docker compose down",
"db:remove": "docker compose down -v"
"db:start": "docker compose up -d db-dev",
"db:stop": "docker compose stop db-dev",
"db:restart": "docker compose restart db-dev",
"db:down": "docker compose rm -sf db-dev",
"db:remove": "docker compose rm -sfv db-dev",
"db:test": "source .env.test && docker compose up db-test",
"db:test:start": "docker compose --env-file .env.test up -d db-test",
"db:test:stop": "docker compose --env-file .env.test stop db-test",
"db:test:down": "docker compose --env-file .env.test rm -sf db-test",
"db:test:remove": "docker compose --env-file .env.test rm -sf db-test",
"db:test:push": "bun --env-file=.env.test run prisma db push"
},
"dependencies": {
"@bedtime-coders/elysia-openapi": "^1.1.0",
Expand Down
7 changes: 4 additions & 3 deletions scripts/test/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ const EMAIL = env.EMAIL;
const PASSWORD = env.PASSWORD;
const POSTMAN_COLLECTION = env.POSTMAN_COLLECTION;

// Performance options
const DELAY_REQUEST = env.DELAY_REQUEST;

// Parse command line arguments
const { values } = parseArgs({
args: Bun.argv,
Expand All @@ -35,6 +32,10 @@ const { values } = parseArgs({
const shouldSkipDbReset = values["skip-db-reset"] || env.SKIP_DB_RESET;
const isWatchMode = values.watch || false;

// Performance options
const DELAY_REQUEST = env.DELAY_REQUEST;
// Note: Newman doesn't support parallel execution, but we can reduce delays

console.info(chalk.gray("Checking Bedstack health"));

// first query the api to see if it's running
Expand Down
2 changes: 1 addition & 1 deletion src/tags/tags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { expectNoError, registerAndLoginUser } from "@/tests/utils";
// Create type-safe API client with Eden Treaty
const { api } = treaty(app);

// Test dataW
// Test data
const testUser = {
email: "tags_test@test.com",
username: "tags_test_user",
Expand Down
1 change: 1 addition & 0 deletions src/tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export async function resetDb(options: { verbose?: boolean } = {}) {
`);

if (options.verbose) {
// biome-ignore lint/suspicious/noConsole: we want to log this
console.log(`✅ Database reset: truncated ${tableNames.length} tables`);
}
} catch (error) {
Expand Down