switch from Jest to Vitest

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2026-02-16 11:51:07 +01:00
parent c3c1213116
commit fa21647770
56 changed files with 1374 additions and 3361 deletions

View File

@@ -14,17 +14,17 @@
* limitations under the License.
*/
import {jest} from '@jest/globals';
import {vi} from 'vitest';
import os from 'os';
export const mockPlatform = (platform: NodeJS.Platform) => {
return jest.spyOn(os, 'platform').mockImplementation(() => platform);
return vi.spyOn(os, 'platform').mockImplementation(() => platform);
};
export const mockArch = (arch: string) => {
return jest.spyOn(os, 'arch').mockImplementation(() => arch);
return vi.spyOn(os, 'arch').mockImplementation(() => arch);
};
export const mockHomedir = (dir: string) => {
return jest.spyOn(os, 'homedir').mockImplementation(() => dir);
return vi.spyOn(os, 'homedir').mockImplementation(() => dir);
};