Files
5chan/electron/kubo-paths.test.js
T
Tommaso CasaburiandGitHub a67c66de0d perf(electron): speed up Windows packaging with ASAR (#1190)
* perf(electron): package Windows app with ASAR

* fix(electron): use portable ASAR unpack glob

* fix(electron): unpack native modules from ASAR
2026-08-01 12:50:23 +02:00

19 lines
739 B
JavaScript

import path from 'node:path';
import { describe, expect, it } from 'vitest';
import { getPackagedKuboPaths } from './kubo-paths.js';
describe('getPackagedKuboPaths', () => {
it.each([
['win32', 'win', 'ipfs.exe'],
['darwin', 'mac', 'ipfs'],
['linux', 'linux', 'ipfs'],
])('prefers the unpacked ASAR binary on %s and retains the loose-package fallback', (platform, platformDirectory, binaryName) => {
const resourcesPath = path.join('/tmp', '5chan', 'resources');
expect(getPackagedKuboPaths(resourcesPath, platform)).toEqual([
path.join(resourcesPath, 'app.asar.unpacked', 'bin', platformDirectory, binaryName),
path.join(resourcesPath, 'app', 'bin', platformDirectory, binaryName),
]);
});
});