test instead of it
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, test } from 'vitest'
|
||||||
import { RegionalMarketCache } from './RegionalMarketCache'
|
import { RegionalMarketCache } from './RegionalMarketCache'
|
||||||
|
|
||||||
describe('RegionalMarketCache', () => {
|
describe('RegionalMarketCache', () => {
|
||||||
it('should cache and retrieve values', async () => {
|
test('should cache and retrieve values', async () => {
|
||||||
const cache = new RegionalMarketCache<string>(1000)
|
const cache = new RegionalMarketCache<string>(1000)
|
||||||
|
|
||||||
cache.set(1, 1, 'test')
|
cache.set(1, 1, 'test')
|
||||||
expect(cache.get(1, 1)).toBe('test')
|
expect(cache.get(1, 1)).toBe('test')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should remove values', async () => {
|
test('should remove values', async () => {
|
||||||
const cache = new RegionalMarketCache<string>(1000)
|
const cache = new RegionalMarketCache<string>(1000)
|
||||||
|
|
||||||
cache.set(1, 1, 'test')
|
cache.set(1, 1, 'test')
|
||||||
@@ -17,7 +17,7 @@ describe('RegionalMarketCache', () => {
|
|||||||
expect(cache.get(1, 1)).toBeUndefined()
|
expect(cache.get(1, 1)).toBeUndefined()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should compute values if absent', async () => {
|
test('should compute values if absent', async () => {
|
||||||
const cache = new RegionalMarketCache<string>(1000)
|
const cache = new RegionalMarketCache<string>(1000)
|
||||||
const value = await cache.computeIfAbsent(1, 1, () => Promise.resolve('test'))
|
const value = await cache.computeIfAbsent(1, 1, () => Promise.resolve('test'))
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ describe('RegionalMarketCache', () => {
|
|||||||
expect(cache.get(1, 1)).toBe('test')
|
expect(cache.get(1, 1)).toBe('test')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should expire values', async () => {
|
test('should expire values', async () => {
|
||||||
const cache = new RegionalMarketCache<string>(1)
|
const cache = new RegionalMarketCache<string>(1)
|
||||||
|
|
||||||
cache.set(1, 1, 'test')
|
cache.set(1, 1, 'test')
|
||||||
|
|||||||
Reference in New Issue
Block a user