Skip to content

Commit d1c3dde

Browse files
authored
Project dependencies update (#1084)
1 parent f533988 commit d1c3dde

File tree

8 files changed

+1263
-2125
lines changed

8 files changed

+1263
-2125
lines changed

app/utils/providers/github.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createId as cuid } from '@paralleldrive/cuid2'
33
import { redirect } from 'react-router'
44
import { GitHubStrategy } from 'remix-auth-github'
55
import { z } from 'zod'
6-
import { cache, cachified } from '../cache.server.ts'
6+
import { cache, cachified } from '#app/utils/cache.server.ts'
77
import { type Timings } from '../timing.server.ts'
88
import { MOCK_CODE_GITHUB_HEADER, MOCK_CODE_GITHUB } from './constants.ts'
99
import { type AuthProvider } from './provider.ts'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Mock Cache Server in Tests
2+
3+
Date: 2026-02-01
4+
5+
Status: accepted
6+
7+
## Context
8+
9+
Our Vitest suite runs in a Vite-powered environment that attempts to bundle
10+
imports for jsdom tests. The app cache implementation imports `node:sqlite`,
11+
which Vite cannot bundle for client-like environments. This caused CI failures
12+
when Vitest upgraded and began resolving the cache module for jsdom suites.
13+
Additionally, the cache module requires `CACHE_DATABASE_PATH`, which is not
14+
needed for unit tests and creates friction for running tests locally.
15+
16+
## Decision
17+
18+
We will provide a test-only cache server stub and instruct Vite/Vitest to
19+
resolve `cache.server.ts` to this stub when running Vitest. The stub provides
20+
in-memory cache behavior and a minimal `cachified` implementation sufficient
21+
for the tests. Production and development builds continue to use the real
22+
SQLite-backed cache implementation.
23+
24+
## Consequences
25+
26+
- **Stable CI tests**: Vitest no longer tries to bundle `node:sqlite`, and the
27+
cache module no longer requires `CACHE_DATABASE_PATH` in unit tests.
28+
- **Scoped behavior**: Cache behavior in unit tests is simplified to in-memory
29+
semantics, so SQLite-specific behavior is not exercised in those tests.
30+
- **No runtime impact**: Only Vitest uses the stub; production and development
31+
environments remain unchanged.

0 commit comments

Comments
 (0)