mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-02 07:21:33 -07:00
fbfdea7c64
- Preference store keys entries by extension package + bridge source id; legacy unscoped entries are discarded once instead of being handed to whichever extension asks first - Source picker's "Load more" appends the next page without duplicating streamed results - Repository index fetches and subtitle/APK downloads now time out and are size-bounded instead of hanging or growing unbounded - APK installs are staged to a temp file and renamed into place - Stream metadata lookup matches the requested path, not only the currently playing one - Reworked animeui into browse-state/detail-panel/panels.css modules - Reverted premature CHANGELOG unreleased entries; refreshed anime-browser docs
37 lines
1.4 KiB
TypeScript
37 lines
1.4 KiB
TypeScript
import assert from 'node:assert/strict';
|
|
import { existsSync, readFileSync } from 'node:fs';
|
|
import test from 'node:test';
|
|
|
|
const source = readFileSync('scripts/prepare-build-assets.mjs', 'utf8');
|
|
|
|
test('macOS helper build creates dist scripts directory before swiftc output', () => {
|
|
const buildFunctionIndex = source.indexOf('function buildMacosHelper()');
|
|
assert.notEqual(buildFunctionIndex, -1);
|
|
|
|
const swiftcIndex = source.indexOf("execFileSync('swiftc'", buildFunctionIndex);
|
|
assert.notEqual(swiftcIndex, -1);
|
|
|
|
const ensureDirIndex = source.lastIndexOf('ensureDir(scriptsOutputDir)', swiftcIndex);
|
|
|
|
assert.ok(
|
|
ensureDirIndex > buildFunctionIndex,
|
|
'buildMacosHelper must create dist/scripts before swiftc writes the helper binary',
|
|
);
|
|
});
|
|
|
|
test('anime UI stylesheet files exist and are all staged', () => {
|
|
const html = readFileSync('src/animeui/index.html', 'utf8');
|
|
const stylesheets = [...html.matchAll(/<link rel="stylesheet" href="\.\/(.+?\.css)"/g)].map(
|
|
(match) => match[1],
|
|
);
|
|
|
|
assert.deepEqual(stylesheets, ['style.css', 'detail.css', 'panels.css']);
|
|
for (const stylesheet of stylesheets) {
|
|
assert.equal(existsSync(`src/animeui/${stylesheet}`), true, `${stylesheet} must exist`);
|
|
}
|
|
assert.match(
|
|
source,
|
|
/copyAssets\(animeUiSourceDir, animeUiOutputDir, 'animeui', \[\s*'style\.css',\s*'detail\.css',\s*'panels\.css',?\s*\]\)/,
|
|
);
|
|
});
|