···11-import test from 'ava';
11+import {expect, test} from 'vitest';
22import {increment} from '../source/index.js';
3344type TestCase = {
···1717];
18181919for (const {from, to} of testCases) {
2020- test(`increments ${from} to ${to}`, (t) => {
2121- t.is(increment(from), to);
2020+ test(`increments ${from} to ${to}`, () => {
2121+ expect(increment(from)).toBe(to);
2222 });
2323}
+5-5
test/random.ts
···11-import test from 'ava';
11+import {expect, test} from 'vitest';
22import {random, range} from '../source/index.js';
3344-test('returns a valid string given only an upper bound', (t) => {
44+test('returns a valid string given only an upper bound', () => {
55 const validLetters = range('AAA');
6677 for (let i = 0; i < 1000; ++i) {
88- t.assert(validLetters.includes(random('ZZ')));
88+ expect(validLetters.includes(random('ZZ'))).toBe(true);
99 }
1010});
11111212-test('returns a valid string given both upper and lower bounds', (t) => {
1212+test('returns a valid string given both upper and lower bounds', () => {
1313 const validLetters = range('AA', 'AAA');
14141515 for (let i = 0; i < 1000; ++i) {
1616- t.assert(validLetters.includes(random('AA', 'ZZ')));
1616+ expect(validLetters.includes(random('AA', 'ZZ'))).toBe(true);
1717 }
1818});
+12-12
test/range.ts
···11-import test from 'ava';
11+import {expect, test} from 'vitest';
22import {range} from '../source/index.js';
3344-test('works with end', (t) => {
55- t.deepEqual(range('A'), []);
66- t.deepEqual(range('B'), ['A']);
77- t.deepEqual(range('C'), ['A', 'B']);
88- t.assert(range('AB').includes('AA'));
44+test('works with end', () => {
55+ expect(range('A')).toEqual([]);
66+ expect(range('B')).toEqual(['A']);
77+ expect(range('C')).toEqual(['A', 'B']);
88+ expect(range('AB').includes('AA')).toBe(true);
99});
10101111-test('works with start and end', (t) => {
1212- t.deepEqual(range('B', 'C'), ['B']);
1313- t.deepEqual(range('B', 'D'), ['B', 'C']);
1414- t.deepEqual(range('ZZ', 'AAC'), ['ZZ', 'AAA', 'AAB']);
1111+test('works with start and end', () => {
1212+ expect(range('B', 'C')).toEqual(['B']);
1313+ expect(range('B', 'D')).toEqual(['B', 'C']);
1414+ expect(range('ZZ', 'AAC')).toEqual(['ZZ', 'AAA', 'AAB']);
1515});
16161717-test('throws if given a string with a non-upper-case letter', (t) => {
1818- t.throws(() => range('a'));
1717+test('throws if given a string with a non-upper-case letter', () => {
1818+ expect(() => range('a')).toThrow();
1919});
+3-3
test/to-bb26.ts
···11-import test from 'ava';
11+import {expect, test} from 'vitest';
22import {toBb26} from '../source/index.js';
3344type TestCase = {
···1616];
17171818for (const {from, to} of testCases) {
1919- test(`converts ${from} to ${to}`, (t) => {
2020- t.is(toBb26(from), to);
1919+ test(`converts ${from} to ${to}`, () => {
2020+ expect(toBb26(from)).toBe(to);
2121 });
2222}
+5-5
test/to-decimal.ts
···11-import test from 'ava';
11+import {expect, test} from 'vitest';
22import {toDecimal} from '../source/index.js';
3344type TestCase = {
···1616];
17171818for (const {from, to} of testCases) {
1919- test(`converts ${from} to ${to}`, (t) => {
2020- t.is(toDecimal(from), to);
1919+ test(`converts ${from} to ${to}`, () => {
2020+ expect(toDecimal(from)).toBe(to);
2121 });
2222}
23232424-test('throws for non-upper-case character', (t) => {
2525- t.throws(() => toDecimal('a'));
2424+test('throws for non-upper-case character', () => {
2525+ expect(() => toDecimal('a')).toThrow();
2626});