mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-14 21:26:15 -08:00
fix(perf): optimize benchmark worker builds
This commit is contained in:
1 parent
df7eee7e52
commit
a3a8f6e90c
4 files changed
+42
-6
No files matched your search
@@ -197,7 +197,7 @@ test('the Electron performance wrapper owns build dependencies before its profil
|
||||
assert.ok(target, 'electron-backend must define build-performance');
|
||||
assert.equal(target.executor, 'nx:run-commands');
|
||||
assert.deepEqual(target.dependsOn, [
|
||||
'electron-backend:build-worker',
|
||||
'electron-backend:build-worker-performance',
|
||||
'electron-backend:build-embedded-mpv',
|
||||
{
|
||||
projects: ['web', 'remote-control-web'],
|
||||
@@ -210,6 +210,27 @@ test('the Electron performance wrapper owns build dependencies before its profil
|
||||
);
|
||||
});
|
||||
|
||||
test('the Electron performance wrapper builds optimized source-mapped workers', () => {
|
||||
const target = electronProject.targets['build-worker-performance'];
|
||||
const source = readFileSync(
|
||||
join(workspaceRoot, 'apps/electron-backend/build-worker.js'),
|
||||
'utf8'
|
||||
);
|
||||
|
||||
assert.ok(target, 'electron-backend must define build-worker-performance');
|
||||
assert.equal(target.executor, 'nx:run-commands');
|
||||
assert.equal(
|
||||
target.options?.['command'],
|
||||
'node apps/electron-backend/build-worker.js --performance'
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
/const isPerformance = process\.argv\.includes\('--performance'\)/
|
||||
);
|
||||
assert.match(source, /minify: isProduction \|\| isPerformance/);
|
||||
assert.match(source, /sourcemap: isPerformance \|\| !isProduction/);
|
||||
});
|
||||
|
||||
test('the cancellation benchmark uses the production-equivalent performance build', () => {
|
||||
const target = e2eProject.targets['benchmark-m3u-refresh-cancellation'];
|
||||
|
||||
|
||||
Reference in new issue
Block a user