test instead of it

This commit is contained in:
2024-05-24 21:28:23 +02:00
parent 9f2627faf8
commit 1868b3e248

View File

@@ -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,7 +25,7 @@ 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')