Files
DndGamePlayer/app/shared/package.build.test.ts
T
Ivan Fontosh 2037144a5c
Release / release (push) Successful in 5m8s
fix(win): load window icon from ICO on disk + buffer PNG (1.0.6)
nativeImage from paths inside app.asar often yields empty images on Windows.
Ship icon.ico via extraResources and read with createFromBuffer; setIcon on boot + app windows.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 08:24:14 +08:00

39 lines
1.4 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 root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
void test('package.json: конфиг electron-builder (mac/win)', () => {
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')) as {
build: {
appId: string;
asar: boolean;
asarUnpack: string[];
extraResources: { from: string; to: string }[];
mac: { target: unknown };
files: string[];
};
};
assert.ok(pkg.build);
assert.equal(pkg.build.appId, 'com.dndplayer.app');
assert.equal(pkg.build.asar, true, 'релизный артефакт: app.asar без «голого» дерева dist в .app/.exe');
assert.ok(Array.isArray(pkg.build.asarUnpack));
assert.ok(pkg.build.asarUnpack.some((p) => p.includes('preload')));
assert.ok(Array.isArray(pkg.build.extraResources));
assert.ok(
pkg.build.extraResources.some(
(e: unknown) =>
typeof e === 'object' &&
e !== null &&
'to' in e &&
typeof (e as { to: unknown }).to === 'string' &&
(e as { to: string }).to.includes('branding'),
),
);
assert.ok(Array.isArray(pkg.build.mac.target));
assert.ok(pkg.build.files.includes('dist/**/*'));
});