Skip to content

Commit 218667c

Browse files
committed
fix: address linting issues
Signed-off-by: Giovanni De Giorgio <[email protected]>
1 parent cee1a4d commit 218667c

File tree

1 file changed

+23
-27
lines changed

1 file changed

+23
-27
lines changed
Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,43 @@
11
import { Cache } from './cache';
22

3-
describe("cache.ts - Cache", ()=>{
3+
describe('cache.ts - Cache', () => {
4+
let cache: Cache;
5+
let setSpy: jest.SpyInstance;
46

5-
let cache : Cache
6-
let setSpy : jest.SpyInstance
7-
8-
beforeAll(()=>{
9-
cache = new Cache({enabled : true})
7+
beforeAll(() => {
8+
cache = new Cache({ enabled: true });
109
setSpy = jest.spyOn(Cache.prototype, 'set');
10+
});
1111

12-
})
13-
14-
it("should return undefined when cache is disabled", ()=>{
15-
cache = new Cache({enabled : false})
12+
it('should return undefined when cache is disabled', () => {
13+
cache = new Cache({ enabled: false });
1614
expect(cache.get('test')).toBeUndefined();
17-
})
15+
});
1816

19-
it("should return undefined when cache is enabled but key is not cached", ()=>{
20-
cache = new Cache({enabled : true})
17+
it('should return undefined when cache is enabled but key is not cached', () => {
18+
cache = new Cache({ enabled: true });
2119
expect(cache.get('test')).toBeUndefined();
22-
})
20+
});
2321

24-
25-
it("should return the cached value when cache is enabled and key is in cache", ()=>{
22+
it('should return the cached value when cache is enabled and key is in cache', () => {
2623
const cache = new Cache({ enabled: true, size: 1, ttl: 1 });
2724
cache.set('test', { value: true, reason: 'test' });
2825
expect(cache.get('test')).toEqual({ value: true, reason: 'test' });
29-
})
26+
});
3027

31-
it("should not set any value when cache is disabled", ()=>{
28+
it('should not set any value when cache is disabled', () => {
3229
expect(setSpy).not.toHaveBeenCalled();
33-
})
30+
});
3431

35-
it("should clear the cache when cache is enabled and .clear() is called", ()=>{
32+
it('should clear the cache when cache is enabled and .clear() is called', () => {
3633
const cache = new Cache({ enabled: true, size: 1, ttl: 1 });
3734
cache.set('test', { value: true, reason: 'test' });
3835
cache.clear();
3936
expect(cache.get('test')).toBeUndefined();
40-
})
41-
42-
afterEach(()=>{
43-
cache = new Cache({enabled : true})
44-
jest.clearAllMocks()
45-
})
46-
})
37+
});
4738

39+
afterEach(() => {
40+
cache = new Cache({ enabled: true });
41+
jest.clearAllMocks();
42+
});
43+
});

0 commit comments

Comments
 (0)