Migrate tests to Vitest

This commit is contained in:
Mike Cao committed 2026-05-14 22:05:34 -07:00
1 parent cbe4d79b3c
commit c0ea3aefbe
15 files changed
+1393 -1839

No files matched your search

@@ -1,11 +1,9 @@
import {
BOARD_ENTITY_TYPES,
isBoardComponentSupported,
} from '../boards';
import { expect, test } from 'vitest';
import {
BOARD_COMPONENT_COMPATIBILITY_MATRIX,
getSupportedBoardComponentEntityTypes,
} from '../boardComponentCompatibility';
} from './boardComponentCompatibility';
import { BOARD_ENTITY_TYPES, isBoardComponentSupported } from './boards';
test('isBoardComponentSupported allows events chart on website boards', () => {
expect(isBoardComponentSupported('EventsChart', BOARD_ENTITY_TYPES.website)).toBe(true);
@@ -1,4 +1,5 @@
import { renderNumberLabels } from '../charts';
import { describe, expect, test } from 'vitest';
import { renderNumberLabels } from './charts';
// test for renderNumberLabels
@@ -1,7 +1,7 @@
import { getIpAddress } from '../ip';
import { expect, test } from 'vitest';
import { getIpAddress } from './ip';
const IP = '127.0.0.1';
const BAD_IP = '127.127.127.127';
test('getIpAddress: Custom header', () => {
process.env.CLIENT_IP_HEADER = 'x-custom-ip-header';
@@ -1,4 +1,5 @@
import * as format from '../format';
import { expect, test } from 'vitest';
import * as format from './format';
test('parseTime', () => {
expect(format.parseTime(86400 + 3600 + 60 + 1)).toEqual({
@@ -1,5 +1,6 @@
import { HOMEPAGE_URL } from '../constants';
import { getBaseUrl } from '../get-base-url';
import { expect, test } from 'vitest';
import { HOMEPAGE_URL } from './constants';
import { getBaseUrl } from './get-base-url';
function createHeaders(entries: Record<string, string>) {
return {
@@ -1,4 +1,5 @@
import { matchesConfiguredPath } from '../match-configured-path';
import { expect, test } from 'vitest';
import { matchesConfiguredPath } from './match-configured-path';
test('matches the exact configured path', () => {
expect(matchesConfiguredPath('/d.js', 'd.js')).toBe(true);