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'
|
||||
|
||||
describe('RegionalMarketCache', () => {
|
||||
it('should cache and retrieve values', async () => {
|
||||
test('should cache and retrieve values', async () => {
|
||||
const cache = new RegionalMarketCache<string>(1000)
|
||||
|
||||
cache.set(1, 1, 'test')
|
||||
expect(cache.get(1, 1)).toBe('test')
|
||||
})
|
||||
|
||||
it('should remove values', async () => {
|
||||
test('should remove values', async () => {
|
||||
const cache = new RegionalMarketCache<string>(1000)
|
||||
|
||||
cache.set(1, 1, 'test')
|
||||
@@ -17,7 +17,7 @@ describe('RegionalMarketCache', () => {
|
||||
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 value = await cache.computeIfAbsent(1, 1, () => Promise.resolve('test'))
|
||||
|
||||
@@ -25,9 +25,9 @@ describe('RegionalMarketCache', () => {
|
||||
expect(cache.get(1, 1)).toBe('test')
|
||||
})
|
||||
|
||||
it('should expire values', async () => {
|
||||
test('should expire values', async () => {
|
||||
const cache = new RegionalMarketCache<string>(1)
|
||||
|
||||
|
||||
cache.set(1, 1, 'test')
|
||||
await new Promise(resolve => setTimeout(resolve, 10))
|
||||
expect(cache.get(1, 1)).toBeUndefined()
|
||||
|
||||
Reference in New Issue
Block a user