$env:PATH = "C:\Users\Abbas\AppData\Local\nodejs-portable\node-v22.14.0-win-x64;$env:PATH"
Set-Location "C:\Users\Abbas\Documents\Downloads\ClaudeAuction2\frontend"

Write-Host "=== Running tests ===" -ForegroundColor Cyan
npx vitest run --reporter=verbose 2>&1
$testExit = $LASTEXITCODE

Write-Host "`n=== Building frontend ===" -ForegroundColor Cyan
npm run build 2>&1
$buildExit = $LASTEXITCODE

Write-Host "`n=== Summary ===" -ForegroundColor Cyan
if ($testExit -eq 0) { Write-Host "Tests: PASS" -ForegroundColor Green }
else { Write-Host "Tests: FAIL (exit $testExit)" -ForegroundColor Red }

if ($buildExit -eq 0) { Write-Host "Build: PASS" -ForegroundColor Green }
else { Write-Host "Build: FAIL (exit $buildExit)" -ForegroundColor Red }
