5e7dc5ea19
- Копировать build/icon.png в dist/renderer/app-pack-icon.png после Vite - Приоритет pack PNG для BrowserWindow; на win32/linux без SVG в nativeImage - macOS: app.dock.setIcon из того же набора PNG - package-lock.json в соответствии с package.json Made-with: Cursor
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import assert from 'node:assert/strict';
|
|
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
import test from 'node:test';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
function readCreateWindows(): string {
|
|
return fs.readFileSync(path.join(here, 'createWindows.ts'), 'utf8');
|
|
}
|
|
|
|
void test('createWindows: закрытие редактора завершает приложение', () => {
|
|
const src = readCreateWindows();
|
|
assert.match(src, /kind === 'editor'/);
|
|
assert.match(src, /win\.on\(\s*['"]close['"]/);
|
|
assert.ok(src.includes('appQuitting'));
|
|
assert.ok(src.includes('e.preventDefault()'));
|
|
assert.ok(src.includes('quitAppFromEditorClose') || src.includes('app.quit()'));
|
|
assert.ok(src.includes('markAppQuitting'));
|
|
});
|
|
|
|
void test('createWindows: иконка окна (pack PNG, затем window PNG; SVG только вне win32)', () => {
|
|
const src = readCreateWindows();
|
|
assert.ok(src.includes('resolveWindowIconPath'));
|
|
assert.ok(src.includes('app-pack-icon.png'));
|
|
assert.ok(src.includes('app-window-icon.png'));
|
|
assert.ok(src.includes('app-logo.svg'));
|
|
});
|