feat: introduce Jest testing framework and decouple Product logic
- Added Jest infrastructure (deps, config, global mocks) - Introduced ISpreadsheetService with GAS and Mock implementations - Refactored Product.ts to use dependency injection - Added unit tests for Product class - Updated documentation (README, SETUP, ARCHITECTURE) to reflect testing and init scripts
This commit is contained in:
@ -2,23 +2,24 @@
|
||||
|
||||
## Local Development Environment
|
||||
|
||||
1. **Install Node.js**
|
||||
This project uses `fnm` to manage Node versions.
|
||||
1. **Environment Initialization**
|
||||
Run the provided PowerShell script to automatically install:
|
||||
- `fnm` (Fast Node Manager) via Winget
|
||||
- Node.js (v22)
|
||||
- Global dependencies (`@google/clasp`)
|
||||
- Project dependencies (`npm install`)
|
||||
|
||||
```powershell
|
||||
# Install fnm (if not installed)
|
||||
winget install Schniz.fnm
|
||||
# Configure environment
|
||||
fnm env --use-on-cd | Out-String | Invoke-Expression
|
||||
# Install Node version
|
||||
fnm use --install-if-missing 22
|
||||
.\init.ps1
|
||||
```
|
||||
|
||||
2. **Install Dependencies**
|
||||
2. **Verify Installation**
|
||||
Run tests to confirm the environment is correctly configured.
|
||||
```bash
|
||||
npm install
|
||||
npm install -g @google/clasp
|
||||
npm test
|
||||
```
|
||||
|
||||
|
||||
3. **Clasp Login**
|
||||
Authenticate with Google to allow pushing code.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user