[PR #15] [MERGED] feat: add comprehensive test suite with Vitest #15

Closed
opened 2026-02-27 15:56:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rersozlu/food402/pull/15
Author: @rersozlu
Created: 2/2/2026
Status: Merged
Merged: 2/3/2026
Merged by: @rersozlu

Base: masterHead: add-test-suite


📝 Commits (3)

  • 49dfbd8 feat: add comprehensive test suite with Vitest
  • ffa46ea Merge master and reorganize Google Reviews tests
  • d4c1e18 fix: add GOOGLE_PLACES_API_KEY placeholder to postinstall config

📊 Changes

21 files changed (+1911 additions, -686 deletions)

View changed files

📝 .gitignore (+2 -0)
📝 README.md (+33 -0)
📝 package-lock.json (+420 -668)
📝 package.json (+6 -3)
📝 src/postinstall.ts (+2 -1)
test/.env.test.example (+6 -0)
test/integration/addresses.test.ts (+155 -0)
test/integration/basket.test.ts (+266 -0)
test/integration/menu.test.ts (+213 -0)
test/integration/orders.test.ts (+176 -0)
test/integration/payment.test.ts (+106 -0)
test/integration/restaurants.test.ts (+176 -0)
📝 test/modules/google-reviews/cache.test.ts (+2 -2)
📝 test/modules/google-reviews/google-reviews.test.ts (+1 -1)
📝 test/modules/google-reviews/matching.test.ts (+2 -2)
test/security/credentials.test.ts (+177 -0)
test/setup/auth.ts (+38 -0)
test/setup/env.ts (+42 -0)
test/setup/fixtures.ts (+70 -0)
test/vitest.config.ts (+18 -0)

...and 1 more files

📄 Description

Summary

  • Add integration tests covering all API endpoints (addresses, restaurants, menu, basket, orders, payment)
  • Add security tests to validate credential handling (no hardcoded secrets in source)
  • Add test fixtures and utilities with retry logic for flaky API calls
  • Configure Vitest with verbose reporter and v8 coverage
  • Update README with testing documentation

Test Coverage

Module Tests
Addresses getCities, getDistricts, getNeighborhoods, getAddresses, addAddress
Restaurants getRestaurants, searchRestaurants with filters
Menu getRestaurantMenu, getProductDetails, getProductRecommendations
Basket addToBasket, getBasket, removeFromBasket, clearBasket, updateCustomerNote
Payment getSavedCards, getCheckoutReady (placeOrder skipped to avoid charges)
Orders getOrders, getOrderDetail
Security No hardcoded credentials, env vars properly used, .gitignore coverage

Setup

cp test/.env.test.example test/.env.test
# Add your TGO credentials
npm test

Test plan

  • All 68 tests pass locally
  • Security review completed - no credential exposure
  • .env.test excluded via .gitignore

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rersozlu/food402/pull/15 **Author:** [@rersozlu](https://github.com/rersozlu) **Created:** 2/2/2026 **Status:** ✅ Merged **Merged:** 2/3/2026 **Merged by:** [@rersozlu](https://github.com/rersozlu) **Base:** `master` ← **Head:** `add-test-suite` --- ### 📝 Commits (3) - [`49dfbd8`](https://github.com/rersozlu/food402/commit/49dfbd83f2695b2049834502d4900ce274ad6cda) feat: add comprehensive test suite with Vitest - [`ffa46ea`](https://github.com/rersozlu/food402/commit/ffa46ea777430217f7f270be8b572be545d28c4c) Merge master and reorganize Google Reviews tests - [`d4c1e18`](https://github.com/rersozlu/food402/commit/d4c1e182866c1f96705d51cf2bd08d1c927debfe) fix: add GOOGLE_PLACES_API_KEY placeholder to postinstall config ### 📊 Changes **21 files changed** (+1911 additions, -686 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+2 -0) 📝 `README.md` (+33 -0) 📝 `package-lock.json` (+420 -668) 📝 `package.json` (+6 -3) 📝 `src/postinstall.ts` (+2 -1) ➕ `test/.env.test.example` (+6 -0) ➕ `test/integration/addresses.test.ts` (+155 -0) ➕ `test/integration/basket.test.ts` (+266 -0) ➕ `test/integration/menu.test.ts` (+213 -0) ➕ `test/integration/orders.test.ts` (+176 -0) ➕ `test/integration/payment.test.ts` (+106 -0) ➕ `test/integration/restaurants.test.ts` (+176 -0) 📝 `test/modules/google-reviews/cache.test.ts` (+2 -2) 📝 `test/modules/google-reviews/google-reviews.test.ts` (+1 -1) 📝 `test/modules/google-reviews/matching.test.ts` (+2 -2) ➕ `test/security/credentials.test.ts` (+177 -0) ➕ `test/setup/auth.ts` (+38 -0) ➕ `test/setup/env.ts` (+42 -0) ➕ `test/setup/fixtures.ts` (+70 -0) ➕ `test/vitest.config.ts` (+18 -0) _...and 1 more files_ </details> ### 📄 Description ## Summary - Add integration tests covering all API endpoints (addresses, restaurants, menu, basket, orders, payment) - Add security tests to validate credential handling (no hardcoded secrets in source) - Add test fixtures and utilities with retry logic for flaky API calls - Configure Vitest with verbose reporter and v8 coverage - Update README with testing documentation ## Test Coverage | Module | Tests | |--------|-------| | Addresses | getCities, getDistricts, getNeighborhoods, getAddresses, addAddress | | Restaurants | getRestaurants, searchRestaurants with filters | | Menu | getRestaurantMenu, getProductDetails, getProductRecommendations | | Basket | addToBasket, getBasket, removeFromBasket, clearBasket, updateCustomerNote | | Payment | getSavedCards, getCheckoutReady (placeOrder skipped to avoid charges) | | Orders | getOrders, getOrderDetail | | Security | No hardcoded credentials, env vars properly used, .gitignore coverage | ## Setup ```bash cp test/.env.test.example test/.env.test # Add your TGO credentials npm test ``` ## Test plan - [x] All 68 tests pass locally - [x] Security review completed - no credential exposure - [x] `.env.test` excluded via `.gitignore` 🤖 Generated with [Claude Code](https://claude.ai/code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 15:56:49 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/food402#15
No description provided.