* Test setting defaultShell to pwsh (PowerShell Core)
()
| 250 | * Test setting defaultShell to pwsh (PowerShell Core) |
| 251 | */ |
| 252 | async function testDefaultShellPwsh() { |
| 253 | console.log('\nTest 4: Setting defaultShell to pwsh'); |
| 254 | |
| 255 | // Check if pwsh is available |
| 256 | const isAvailable = await isShellAvailable('pwsh'); |
| 257 | if (!isAvailable) { |
| 258 | console.log('⚠️ Skipping pwsh test: PowerShell Core not available on this system'); |
| 259 | return; |
| 260 | } |
| 261 | |
| 262 | // Set defaultShell to pwsh |
| 263 | await configManager.setValue('defaultShell', 'pwsh'); |
| 264 | |
| 265 | // Verify config was set correctly |
| 266 | const config = await configManager.getConfig(); |
| 267 | assert.strictEqual(config.defaultShell, 'pwsh', 'defaultShell should be set to pwsh'); |
| 268 | console.log(`✓ Configuration updated: defaultShell = ${config.defaultShell}`); |
| 269 | |
| 270 | // Execute PowerShell command to check the shell |
| 271 | const shellOutput = await getShellFromCommand('pwsh'); |
| 272 | console.log(`✓ Command output: ${shellOutput}`); |
| 273 | |
| 274 | // Verify the shell is pwsh |
| 275 | const expectedOutputs = getExpectedShellOutput('pwsh'); |
| 276 | const isValidOutput = expectedOutputs.includes(shellOutput); |
| 277 | assert(isValidOutput, `Shell should be one of ${expectedOutputs.join(', ')}, got: ${shellOutput}`); |
| 278 | console.log('✓ Test 4 passed: pwsh is correctly set as default shell'); |
| 279 | } |
| 280 | /** |
| 281 | * Test switching between different shells |
| 282 | */ |
no test coverage detected