mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-20 05:26:20 +00:00
Update tests to use vi instead of jest
This commit is contained in:
@@ -2,13 +2,13 @@ import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { LocalStorage } from '../../../src/utils/services/LocalStorage';
|
||||
|
||||
describe('LocalStorage', () => {
|
||||
const getItem = jest.fn((key) => (key === 'shlink.foo' ? JSON.stringify({ foo: 'bar' }) : null));
|
||||
const setItem = jest.fn();
|
||||
const getItem = vi.fn((key) => (key === 'shlink.foo' ? JSON.stringify({ foo: 'bar' }) : null));
|
||||
const setItem = vi.fn();
|
||||
const localStorageMock = fromPartial<Storage>({ getItem, setItem });
|
||||
let storage: LocalStorage;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
vi.clearAllMocks();
|
||||
storage = new LocalStorage(localStorageMock);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user