mirror of
https://github.com/Horizontal42/summarum.git
synced 2026-11-11 02:12:00 +03:00
test: add tests for updater.ts
Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>
This commit is contained in:
parent
955c142daf
commit
d90512a433
1 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||||
import { checkForUpdate } from './updater';
|
import { checkForUpdate } from './updater';
|
||||||
import * as storage from './storage';
|
import * as storage from './storage';
|
||||||
|
import type { Update } from '@tauri-apps/plugin-updater';
|
||||||
|
|
||||||
vi.mock('./storage', () => ({
|
vi.mock('./storage', () => ({
|
||||||
isTauri: vi.fn(),
|
isTauri: vi.fn(),
|
||||||
|
|
@ -62,7 +63,7 @@ describe('checkForUpdate', () => {
|
||||||
version: '1.1.0',
|
version: '1.1.0',
|
||||||
currentVersion: '1.0.0',
|
currentVersion: '1.0.0',
|
||||||
downloadAndInstall: vi.fn().mockResolvedValue(undefined),
|
downloadAndInstall: vi.fn().mockResolvedValue(undefined),
|
||||||
};
|
} as unknown as Update;
|
||||||
vi.mocked(check).mockResolvedValue(mockUpdate);
|
vi.mocked(check).mockResolvedValue(mockUpdate);
|
||||||
|
|
||||||
const result = await checkForUpdate();
|
const result = await checkForUpdate();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue