test: Migrate to vitest from jest

This commit is contained in:
Sidharth Vinod
2022-09-07 11:24:40 +05:30
parent 3a179170bb
commit bf4607cf08
29 changed files with 560 additions and 1444 deletions

View File

@@ -1,3 +0,0 @@
export const curveBasis = 'basis';
export const curveLinear = 'linear';
export const curveCardinal = 'cardinal';

View File

@@ -1,3 +1,6 @@
// @ts-nocheck
import { vi } from 'vitest';
let NewD3 = function () {
/**
*
@@ -56,9 +59,9 @@ export const MockD3 = (name, parent) => {
children.push(mockElem);
return mockElem;
};
elem.lower = jest.fn(() => elem);
elem.attr = jest.fn(() => elem);
elem.text = jest.fn(() => elem);
elem.style = jest.fn(() => elem);
elem.lower = vi.fn(() => elem);
elem.attr = vi.fn(() => elem);
elem.text = vi.fn(() => elem);
elem.style = vi.fn(() => elem);
return elem;
};

3
__mocks__/dagre-d3.ts Normal file
View File

@@ -0,0 +1,3 @@
import { vi } from 'vitest';
// export const render = vi.fn();

View File

@@ -0,0 +1,3 @@
module.exports = function (txt: string) {
return txt;
};