fixed format issues
This commit is contained in:
parent
a700818a06
commit
08f713d98b
55 changed files with 5680 additions and 5533 deletions
74
libs/core/cache/test/redis-cache-simple.test.ts
vendored
74
libs/core/cache/test/redis-cache-simple.test.ts
vendored
|
|
@ -1,37 +1,37 @@
|
|||
import { describe, it, expect, beforeEach } from 'bun:test';
|
||||
import { RedisCache } from '../src/redis-cache';
|
||||
import type { CacheOptions } from '../src/types';
|
||||
|
||||
describe('RedisCache Simple', () => {
|
||||
let cache: RedisCache;
|
||||
|
||||
beforeEach(() => {
|
||||
const options: CacheOptions = {
|
||||
keyPrefix: 'test:',
|
||||
ttl: 3600,
|
||||
redisConfig: { host: 'localhost', port: 6379 },
|
||||
};
|
||||
cache = new RedisCache(options);
|
||||
});
|
||||
|
||||
describe('Core functionality', () => {
|
||||
it('should create cache instance', () => {
|
||||
expect(cache).toBeDefined();
|
||||
expect(cache.isReady).toBeDefined();
|
||||
expect(cache.get).toBeDefined();
|
||||
expect(cache.set).toBeDefined();
|
||||
});
|
||||
|
||||
it('should have stats tracking', () => {
|
||||
const stats = cache.getStats();
|
||||
expect(stats).toMatchObject({
|
||||
hits: 0,
|
||||
misses: 0,
|
||||
errors: 0,
|
||||
hitRate: 0,
|
||||
total: 0,
|
||||
});
|
||||
expect(stats.uptime).toBeGreaterThanOrEqual(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
import { beforeEach, describe, expect, it } from 'bun:test';
|
||||
import { RedisCache } from '../src/redis-cache';
|
||||
import type { CacheOptions } from '../src/types';
|
||||
|
||||
describe('RedisCache Simple', () => {
|
||||
let cache: RedisCache;
|
||||
|
||||
beforeEach(() => {
|
||||
const options: CacheOptions = {
|
||||
keyPrefix: 'test:',
|
||||
ttl: 3600,
|
||||
redisConfig: { host: 'localhost', port: 6379 },
|
||||
};
|
||||
cache = new RedisCache(options);
|
||||
});
|
||||
|
||||
describe('Core functionality', () => {
|
||||
it('should create cache instance', () => {
|
||||
expect(cache).toBeDefined();
|
||||
expect(cache.isReady).toBeDefined();
|
||||
expect(cache.get).toBeDefined();
|
||||
expect(cache.set).toBeDefined();
|
||||
});
|
||||
|
||||
it('should have stats tracking', () => {
|
||||
const stats = cache.getStats();
|
||||
expect(stats).toMatchObject({
|
||||
hits: 0,
|
||||
misses: 0,
|
||||
errors: 0,
|
||||
hitRate: 0,
|
||||
total: 0,
|
||||
});
|
||||
expect(stats.uptime).toBeGreaterThanOrEqual(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue