Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge ArgumentsHelper unit tests into one file #6584

Merged
merged 2 commits into from
Jul 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/3 Code Health/6583.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Merge ArgumentsHelper unit tests into one file.
66 changes: 0 additions & 66 deletions src/test/common/argumentsHelper.unit.test.ts

This file was deleted.

19 changes: 17 additions & 2 deletions src/test/testing/common/argsHelper.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ suite('Unit Tests - Arguments Helper', () => {
expect(values).to.be.lengthOf(2);
expect(values).to.be.deep.equal(['value2', 'value3']);
});
test('Get multiple Positional options and ineline values', () => {
test('Get multiple Positional options and inline values', () => {
const args = ['-abc=1234', '--value-option=value1', '--no-value-option', 'value2', 'value3'];
const values = argsHelper.getPositionalArguments(args, ['--value-option', '-abc'], ['--no-value-option']);
expect(values).to.be.array();
Expand All @@ -80,13 +80,28 @@ suite('Unit Tests - Arguments Helper', () => {
expect(values).to.be.lengthOf(1);
expect(values).to.be.deep.equal(['value3']);
});
test('Get multiplle Positional options with trailing value option', () => {
test('Get multiple Positional options with trailing value option', () => {
const args = ['-abc', '1234', '--value-option', 'value1', '--value-option', 'value2', 'value3', '4'];
const values = argsHelper.getPositionalArguments(args, ['--value-option', '-abc'], ['--no-value-option']);
expect(values).to.be.array();
expect(values).to.be.lengthOf(2);
expect(values).to.be.deep.equal(['value3', '4']);
});
test('Get Positional options with unknown args', () => {
const args = ['-abc', '1234', '--value-option', 'value1', '--value-option', 'value2', 'value3', '4'];
const values = argsHelper.getPositionalArguments(args, ['-abc'], ['--no-value-option']);
expect(values).to.be.array();
expect(values).to.be.lengthOf(4);
expect(values).to.be.deep.equal(['value1', 'value2', 'value3', '4']);
});
test('Get Positional options with no options parameters', () => {
const args = ['-abc', '1234', '--value-option', 'value1', '--value-option', 'value2', 'value3', '4'];
const values = argsHelper.getPositionalArguments(args);
expect(values).to.be.array();
expect(values).to.be.lengthOf(5);
expect(values).to.be.deep.equal(['1234', 'value1', 'value2', 'value3', '4']);
expect(values).to.be.deep.equal(argsHelper.getPositionalArguments(args, [], []));
});
test('Filter to remove those with values', () => {
const args = ['-abc', '1234', '--value-option', 'value1', '--value-option', 'value2', 'value3', '4'];
const values = argsHelper.filterArguments(args, ['--value-option']);
Expand Down