Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Test Environment Configuration
# This file is used during test execution

# Use in-memory SQLite for tests — avoids touching the seeded storage/players-sqlite3.db file
STORAGE_PATH=:memory:

# Disable rate limiting for most tests to avoid interference
RATE_LIMIT_ENABLED=false

Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ yarn-error.log*
/prettier-debug.log
.env
*.js
src/data/players-sqlite3.db-shm
src/data/players-sqlite3.db-wal
players-sqlite3.db-shm
players-sqlite3.db-wal
.claude/settings.local.json
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,26 @@ This project uses football/soccer terminology for release names:

### Changed

- Tests switched to in-memory SQLite (`STORAGE_PATH=:memory:`) — seeded via `beforeAll`, production DB never touched during test runs

### Deprecated

## [2.1.0-dribble] - 2026-03-30

### Added

- 15 substitute players seeded in `storage/players-sqlite3.db`

### Changed

- Player dataset normalised to November 2022 World Cup snapshot: Enzo Fernández (SL Benfica / Liga Portugal), Mac Allister (Brighton & Hove Albion), Messi (Paris Saint-Germain / Ligue 1), Di María `abbrPosition` → `RW`
- Player UUIDs replaced with deterministic UUID v5 values (namespace `f201b13e-c670-473d-885d-e2be219f74c8`, formula `{firstName}-{lastName}`)
- Test fixtures renamed for clarity: `playerStub.nonexistent` (Lo Celso, squad 27 — not seeded, used for POST/DELETE) and `playerStub.existing` (Emiliano Martínez, squad 23 — always seeded, used for PUT)
- `playerStub.all` expanded to 26 players
- `PUT describe` in tests: removed `beforeEach`, added `afterEach` to restore Martínez; all tests retargeted to squad 23
- `rest/players.rest` variables updated: `@newSquadNumber = 27`, `@existingSquadNumber = 23`
- Docker: run `docker compose down -v` before `docker compose up` to pick up the rebuilt seeded DB from `storage/players-sqlite3.db` (see #551)

### Removed

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-node-samples-express-restful",
"version": "1.0.0",
"version": "2.1.0-dribble",
"description": "Proof of Concept for a RESTful API made with Node.js 24 (LTS/Krypton), Express.js 5 in TypeScript.",
"type": "module",
"main": "dist/server.js",
Expand Down
43 changes: 21 additions & 22 deletions rest/players.rest
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# https://marketplace.visualstudio.com/items?itemName=humao.rest-client

@baseUrl = http://localhost:9000
@newSquadNumber = 5
@existingSquadNumber = 5
@newSquadNumber = 27
@existingSquadNumber = 23

# -----------------------------------------------------------------------------
# GET /health
Expand Down Expand Up @@ -48,15 +48,14 @@ POST {{baseUrl}}/players
Content-Type: application/json

{
"firstName": "Leandro",
"middleName": "Daniel",
"lastName": "Paredes",
"dateOfBirth": "1994-06-29T00:00:00.000Z",
"squadNumber": 5,
"position": "Defensive Midfield",
"abbrPosition": "DM",
"team": "AS Roma",
"league": "Serie A",
"firstName": "Giovani",
"lastName": "Lo Celso",
"dateOfBirth": "1996-04-09T00:00:00.000Z",
"squadNumber": 27,
"position": "Central Midfield",
"abbrPosition": "CM",
"team": "Villarreal CF",
"league": "La Liga",
"starting11": false
}

Expand Down Expand Up @@ -154,16 +153,16 @@ PUT {{baseUrl}}/players/squadNumber/{{existingSquadNumber}}
Content-Type: application/json

{
"firstName": "Leandro",
"middleName": "Daniel",
"lastName": "Paredes",
"dateOfBirth": "1994-06-29T00:00:00.000Z",
"squadNumber": 5,
"position": "Defensive Midfield",
"abbrPosition": "DM",
"team": "AS Roma",
"league": "Serie A",
"starting11": false
"firstName": "Emiliano",
"middleName": null,
"lastName": "Martínez",
"dateOfBirth": "1992-09-02T00:00:00.000Z",
"squadNumber": 23,
"position": "Goalkeeper",
"abbrPosition": "GK",
"team": "Aston Villa FC",
"league": "Premier League",
"starting11": true
}

### Request PUT /players/squadNumber/{squadNumber} nonexistent → Response status 404 Not Found
Expand Down Expand Up @@ -250,7 +249,7 @@ Content-Type: application/json
# -----------------------------------------------------------------------------

### Request DELETE /players/squadNumber/{squadNumber} existing → Response status 204 No Content
DELETE {{baseUrl}}/players/squadNumber/{{existingSquadNumber}}
DELETE {{baseUrl}}/players/squadNumber/{{newSquadNumber}}

### Request DELETE /players/squadNumber/{squadNumber} nonexistent → Response status 404 Not Found
DELETE {{baseUrl}}/players/squadNumber/99
Binary file modified storage/players-sqlite3.db
Binary file not shown.
Loading
Loading