test(install): pin Windows PATH persistence contract (#16072)

* test(install): pin Windows PATH persistence contract

Co-authored-by: Qwen-Coder <[email protected]>

* test(install): format the pinned PATH assertion

Prettier collapses the single-string expect(...).toContain(...) call at 76
columns, which the incremental lint gate rejected on the previous head.

Co-authored-by: Qwen-Coder <[email protected]>
Patrol-Run: qwen-pr-closeout/jmvygjkzk7s

---------

Co-authored-by: Qwen-Coder <[email protected]>
This commit is contained in:
易良andQwen-Coder authored and GitHub committed 2026-11-02 15:44:05 +08:00
1 parent 6b6df2a8b4
commit 292c0da525
1 file changed
+22
+22
View File
@@ -1424,6 +1424,28 @@ describe('standalone release packaging', () => {
);
});
it('persists the Windows install bin unless PATH updates are disabled', () => {
const script = readScript(
'scripts/installation/install-qwen-standalone.bat',
);
const maybeUpdatePath = readBatchRoutine(script, 'MaybeUpdatePath');
expect(script).toContain(
'if not "!EXTRA_BIN!"=="" if /i not "!NO_MODIFY_PATH!"=="1" (',
);
expect(script).toContain(
'call :PrintFinalInstructions "!INSTALL_BIN_DIR!" "!INSTALL_DIR!" "standalone"',
);
expect(script).toContain('call :MaybeUpdatePath "!EXTRA_BIN!"');
expect(maybeUpdatePath).toContain('set "QWEN_PATH_SCOPE=!PATH_SCOPE!"');
expect(maybeUpdatePath).toContain(
"$target = if ($scope -ieq 'machine') { 'Machine' } else { 'User' }",
);
expect(maybeUpdatePath).toContain(
"[Environment]::SetEnvironmentVariable('Path', $newPath, $target)",
);
});
it('stages hosted installation assets with checksums', async () => {
const {
HOSTED_INSTALLATION_ASSET_NAMES,