Skip to content

Commit

Permalink
more fault tolerant for shell setting (#1100)
Browse files Browse the repository at this point in the history
* more fault tolerant for shell setting

* fix ci check
  • Loading branch information
connectdotz authored Jan 13, 2024
1 parent b3f78ed commit f867798
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/JestExt/run-shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class RunShell {
this.nonLoginShell = setting;
this.loginShell = this.getLoginShell(setting);
} else {
if (setting.args.length > 0) {
if (setting.args?.length > 0) {
this._useLoginShell = true;
this.nonLoginShell = undefined;
this.loginShell = setting;
Expand Down
1 change: 1 addition & 0 deletions tests/JestExt/run-shell.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('RunnerShell', () => {
${6} | ${'darwin'} | ${{ path: 'bash', args: ['--login'] }} | ${{ path: 'bash', args: ['--login'] }} | ${true} | ${undefined}
${7} | ${'linux'} | ${undefined} | ${LoginShells.sh} | ${false} | ${undefined}
${8} | ${'linux'} | ${'whatever'} | ${undefined} | ${'never'} | ${undefined}
${9} | ${'darwin'} | ${{ path: '/bin/zsh' }} | ${LoginShells.zsh} | ${false} | ${'/bin/zsh'}
`('case $case', ({ platform, setting, loginShell, settingOverride, useLoginShell }) => {
jest.clearAllMocks();
mockPlatform.mockReturnValue(platform);
Expand Down

0 comments on commit f867798

Please sign in to comment.