From 36d449ba67ece439e8c52bd3746eae40f3c6135e Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Fri, 16 Oct 2026 05:10:22 -0700 Subject: [PATCH] test: consolidate repeated application rebuild checks (#29628) Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> --- .../scripts/process-host-dev-rebuild.test.ts | 27 +++---------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/config/scripts/process-host-dev-rebuild.test.ts b/config/scripts/process-host-dev-rebuild.test.ts index 1b6514b65a7..bc3647df063 100644 --- a/config/scripts/process-host-dev-rebuild.test.ts +++ b/config/scripts/process-host-dev-rebuild.test.ts @@ -128,7 +128,7 @@ function readEmittedVersion(root: string): number { } describe('External process-host development rebuilds', () => { - it('skips excluded test and fixture changes without reloading the application', async () => { + it('ignores excluded files and rebuilds application edits without recompiling the package', async () => { const { root, packageDir, main } = fixture() const fixtureDir = join(packageDir, 'src', '__fixtures__') mkdirSync(fixtureDir) @@ -159,6 +159,8 @@ describe('External process-host development rebuilds', () => { const rebuilt = nextEvent(watcher, 'END') writeFileSync(main, "module.exports = { ...require('@orca/process-host'), changed: true }\n") await rebuilt + expect(readEmittedVersion(root)).toBe(1) + expect(readFileSync(join(root, 'out', 'main.cjs'), 'utf8')).toContain('changed') expect(readFileSync(join(packageDir, 'builds.txt'), 'utf8')).toBe('build\n') }) @@ -222,29 +224,6 @@ describe('External process-host development rebuilds', () => { .toContain('exports.version') }) - it('skips package compilation when only application code changes', async () => { - const { root, packageDir, main } = fixture() - const watcher = watch({ - input: main, - external: ['@orca/process-host'], - plugins: [createProcessHostDevRebuildPlugin(root)], - output: { file: join(root, 'out', 'main.cjs'), format: 'cjs' } - }) - watchers.push(watcher) - closeSuccessfulBundles(watcher) - await nextEvent(watcher, 'END') - const builds = join(packageDir, 'builds.txt') - expect(readFileSync(builds, 'utf8')).toBe('build\n') - - const rebuilt = nextEvent(watcher, 'END') - writeFileSync(main, "module.exports = { ...require('@orca/process-host'), changed: true }\n") - await rebuilt - - expect(readEmittedVersion(root)).toBe(1) - expect(readFileSync(join(root, 'out', 'main.cjs'), 'utf8')).toContain('changed') - expect(readFileSync(builds, 'utf8')).toBe('build\n') - }) - it('emits private source edits and new imports before the Electron reload hook', async () => { const { root, packageDir, main } = fixture() const loadedVersions: number[] = []