|
14 | 14 |
|
15 | 15 | /* global TextDecoder */ |
16 | 16 |
|
17 | | -import { describe, it, assert, getRuntime } from 'test-anywhere'; |
| 17 | +import { |
| 18 | + describe, |
| 19 | + it, |
| 20 | + assert, |
| 21 | + getRuntime, |
| 22 | + setDefaultTimeout, |
| 23 | +} from 'test-anywhere'; |
18 | 24 | import { readFileSync } from 'node:fs'; |
19 | 25 | import path from 'node:path'; |
20 | 26 | import { fileURLToPath } from 'node:url'; |
21 | 27 |
|
| 28 | +// Set timeout to 20 seconds for slow tests on Windows |
| 29 | +setDefaultTimeout(20000); |
| 30 | + |
22 | 31 | const __dirname = path.dirname(fileURLToPath(import.meta.url)); |
23 | 32 | const scriptPath = path.join( |
24 | 33 | __dirname, |
@@ -166,25 +175,21 @@ describe('gh-download-pull-request CLI', () => { |
166 | 175 | } |
167 | 176 | }); |
168 | 177 |
|
169 | | - it( |
170 | | - 'Invalid PR format should show helpful error', |
171 | | - async () => { |
172 | | - const cmd = getRuntimeCommand(); |
173 | | - const baseArgs = getRuntimeArgs(scriptPath); |
174 | | - const args = [...baseArgs, 'invalid-pr-format']; |
175 | | - |
176 | | - try { |
177 | | - await execCommand(cmd, args); |
178 | | - // If it doesn't throw, that's unexpected |
179 | | - assert.ok(false, 'Should have failed with invalid format'); |
180 | | - } catch (error) { |
181 | | - const output = (error.stdout || '') + (error.stderr || ''); |
182 | | - assert.ok( |
183 | | - output.includes('Invalid PR URL') || output.includes('Invalid PR'), |
184 | | - `Did not show expected error message for invalid format. Output: ${output}` |
185 | | - ); |
186 | | - } |
187 | | - }, |
188 | | - { timeout: 20000 } |
189 | | - ); |
| 178 | + it('Invalid PR format should show helpful error', async () => { |
| 179 | + const cmd = getRuntimeCommand(); |
| 180 | + const baseArgs = getRuntimeArgs(scriptPath); |
| 181 | + const args = [...baseArgs, 'invalid-pr-format']; |
| 182 | + |
| 183 | + try { |
| 184 | + await execCommand(cmd, args); |
| 185 | + // If it doesn't throw, that's unexpected |
| 186 | + assert.ok(false, 'Should have failed with invalid format'); |
| 187 | + } catch (error) { |
| 188 | + const output = (error.stdout || '') + (error.stderr || ''); |
| 189 | + assert.ok( |
| 190 | + output.includes('Invalid PR URL') || output.includes('Invalid PR'), |
| 191 | + `Did not show expected error message for invalid format. Output: ${output}` |
| 192 | + ); |
| 193 | + } |
| 194 | + }); |
190 | 195 | }); |
0 commit comments