1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-07 14:55:27 +02:00

feat(ci): replace jest with vitest [EE-6504] (#10997)
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run

This commit is contained in:
Chaim Lev-Ari 2024-01-23 08:42:52 +02:00 committed by GitHub
parent 4a19871fcc
commit 69c06bc756
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 1137 additions and 1680 deletions

View file

@ -6,7 +6,7 @@ describe('promiseSequence', () => {
});
it('provided two promise functions, the second should run after the first', async () => {
const callback = jest.fn();
const callback = vi.fn();
function first() {
return Promise.resolve(callback(1));

View file

@ -2,10 +2,11 @@ import toastr from 'toastr';
import { notifyError, notifySuccess, notifyWarning } from './notifications';
jest.mock('toastr');
vi.mock('toastr');
vi.spyOn(console, 'error').mockImplementation(() => vi.fn());
afterEach(() => {
jest.resetAllMocks();
vi.resetAllMocks();
});
it('calling success should show success message', () => {
@ -18,9 +19,9 @@ it('calling success should show success message', () => {
});
it('calling error with Error should show error message', () => {
const consoleErrorFn = jest
const consoleErrorFn = vi
.spyOn(console, 'error')
.mockImplementation(() => jest.fn());
.mockImplementation(() => vi.fn());
const title = 'title';
const errorMessage = 'message';
const fallback = 'fallback';
@ -37,9 +38,9 @@ it('calling error with Error should show error message', () => {
});
it('calling error without Error should show fallback message', () => {
const consoleErrorFn = jest
const consoleErrorFn = vi
.spyOn(console, 'error')
.mockImplementation(() => jest.fn());
.mockImplementation(() => vi.fn());
const title = 'title';
const fallback = 'fallback';