mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-19 07:54:38 +00:00
test(installer): cover Windows fake curl helper
This commit is contained in:
parent
1d272f6024
commit
778919f616
1 changed files with 17 additions and 0 deletions
|
|
@ -340,6 +340,22 @@ describe('installation scripts', () => {
|
|||
expect(env.Path).toMatch(/^C:\\qwen-test-bin;/);
|
||||
});
|
||||
|
||||
it('creates a fake Windows curl command script', () => {
|
||||
const tmpDir = mkdtempSync(path.join(tmpdir(), 'qwen-curl-helper-'));
|
||||
|
||||
try {
|
||||
const fakeCurl = createFakeWindowsCurlCommand(tmpDir);
|
||||
|
||||
expect(fakeCurl).toBe(path.join(tmpDir, 'curl.cmd'));
|
||||
expect(readScript(fakeCurl)).toContain('QWEN_FAKE_CURL_LOG');
|
||||
expect(readScript(fakeCurl)).toContain(
|
||||
'/releases/qwen-code/latest/VERSION',
|
||||
);
|
||||
} finally {
|
||||
rmSync(tmpDir, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
it('creates PowerShell validation scripts with a ps1 extension', () => {
|
||||
const script = readScript(
|
||||
'scripts/installation/install-qwen-standalone.bat',
|
||||
|
|
@ -2774,6 +2790,7 @@ function createFakeWindowsCurlCommand(fakeBin) {
|
|||
mkdirSync(fakeBin, { recursive: true });
|
||||
const outputPath = path.join(fakeBin, 'curl.cmd');
|
||||
writeFileSync(
|
||||
outputPath,
|
||||
[
|
||||
'@echo off',
|
||||
'setlocal EnableExtensions EnableDelayedExpansion',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue