Skip to content

Commit

Permalink
Make vitests idiomatic
Browse files Browse the repository at this point in the history
  • Loading branch information
toasted-nutbread committed Feb 11, 2024
1 parent e8079a6 commit a90ee2b
Show file tree
Hide file tree
Showing 11 changed files with 316 additions and 601 deletions.
18 changes: 2 additions & 16 deletions test/cache-map.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -32,10 +31,7 @@ function testConstructor() {
expect(() => new CacheMap(param)).toThrowError();
});
});
}

/** */
function testApi() {
describe('api', () => {
/* eslint-disable @stylistic/no-multi-spaces */
const data = [
Expand Down Expand Up @@ -111,14 +107,4 @@ function testApi() {
expect(cache.size).toStrictEqual(expectedSize);
});
});
}


/** */
function main() {
testConstructor();
testApi();
}


main();
});
Loading

0 comments on commit a90ee2b

Please sign in to comment.