From 1e69210b53151f31140bb1fbdc9f3d71fa181630 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 16 Feb 2024 19:33:24 -0500 Subject: Make vitests idiomatic (#677) --- test/cache-map.test.js | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'test/cache-map.test.js') diff --git a/test/cache-map.test.js b/test/cache-map.test.js index 9be5363a..e7a8b836 100644 --- a/test/cache-map.test.js +++ b/test/cache-map.test.js @@ -19,8 +19,7 @@ import {describe, expect, test} from 'vitest'; import {CacheMap} from '../ext/js/general/cache-map.js'; -/** */ -function testConstructor() { +describe('CacheMap', () => { describe('constructor', () => { const shouldThrow = [-1, 1.5, Number.NaN, Number.POSITIVE_INFINITY]; const shouldNotThrow = [0, 1, Number.MAX_VALUE]; @@ -32,10 +31,7 @@ function testConstructor() { expect(() => new CacheMap(param)).toThrowError(); }); }); -} -/** */ -function testApi() { describe('api', () => { /* eslint-disable @stylistic/no-multi-spaces */ const data = [ @@ -111,14 +107,4 @@ function testApi() { expect(cache.size).toStrictEqual(expectedSize); }); }); -} - - -/** */ -function main() { - testConstructor(); - testApi(); -} - - -main(); +}); -- cgit v1.2.3