Skip to content

Commit

Permalink
381st Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam-Chen committed Sep 24, 2024
1 parent ef15991 commit a4cdeec
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 93 deletions.
3 changes: 1 addition & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@
"pbkdf2-passworder": "1.0.1"
},
"devDependencies": {
"@types/ioredis-mock": "8.2.5",
"@types/nodemailer": "6.4.16",
"@types/nunjucks": "3.2.6",
"@vitest/coverage-v8": "2.1.1",
"ioredis-mock": "8.9.0",
"mongodb-memory-server": "10.0.1",
"process-envify": "2.0.0",
"redis-memory-server": "0.11.0",
"typescript": "5.6.2",
"vite": "5.4.7",
"vite-node": "2.1.1",
Expand Down
11 changes: 8 additions & 3 deletions app/src/routes/hello-world/caching/__tests__/+handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ import KeyvRedis from '@keyv/redis';
import { createCache } from 'cache-manager';
import { CacheableMemory } from 'cacheable';
import fastify from 'fastify';
import Redis from 'ioredis-mock';
import Redis from 'ioredis';
import Keyv from 'keyv';
import { RedisMemoryServer } from 'redis-memory-server';

import cachingHandler from '../+handler';

vi.mock('~/utilities/cache', async () => {
const redisInstance = new Redis();
vi.mock(import('~/utilities/cache'), async () => {
const redisServer = new RedisMemoryServer();
const host = await redisServer.getHost();
const port = await redisServer.getPort();

const redisInstance = new Redis(`redis://${host}:${port}`);

const cache = createCache({
stores: [
Expand Down
Loading

0 comments on commit a4cdeec

Please sign in to comment.