Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use working-dir from "composer-options" (#107)
- Loading branch information
Showing
19 changed files
with
2,356 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { getComposerWorkingDir } from '../../src/utils/getComposerWorkingDir'; | ||
|
||
jest.mock('@actions/core'); | ||
|
||
describe('getComposerWorkingDir', () => { | ||
test('with empty options', () => { | ||
expect(getComposerWorkingDir()).toEqual(''); | ||
}); | ||
|
||
test('with --working-dir option', () => { | ||
expect(getComposerWorkingDir('--working-dir subdirectory')).toEqual('subdirectory'); | ||
}); | ||
|
||
test('with -d (alias of --working-dir) option', () => { | ||
expect(getComposerWorkingDir('-d subdirectory')).toEqual('subdirectory'); | ||
}); | ||
|
||
test('with other options AND without --working-dir', () => { | ||
expect(getComposerWorkingDir('-vv --no-plugins')).toEqual(''); | ||
}); | ||
|
||
test('with other options AND with --working-dir', () => { | ||
expect(getComposerWorkingDir('-vv --working-dir subdirectory --no-plugins')).toEqual('subdirectory'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {parseStringToArguments} from '../../src/utils' | ||
|
||
describe('parseStringToArguments', () => { | ||
test('empty args', () => { | ||
expect(parseStringToArguments('')).toEqual({ | ||
_: [] | ||
}) | ||
}) | ||
|
||
test('only positional argument', () => { | ||
expect(parseStringToArguments('test')).toEqual({ | ||
_: ['test'] | ||
}) | ||
}) | ||
|
||
test('positional argument with lot of options', () => { | ||
expect( | ||
parseStringToArguments( | ||
'--no-plugins --profile --working-dir subdirectory test' | ||
) | ||
).toEqual({ | ||
_: ['test'], | ||
plugins: false, | ||
profile: true, | ||
'working-dir': 'subdirectory' | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.