Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Commit

Permalink
Added tests for list type parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
RazzM13 committed Apr 13, 2018
1 parent f210aa1 commit cfb6929
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/indexTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,24 @@ describe('index', () => {
done();
});
}).timeout(5000);

it('parameters of the CommaDelimitedList type should accept lists as values', (done) => {
exec('node lib/index.js validate testData/valid/yaml/parameters_type_commadelimitedlist.yaml --parameters SomeParam="test\\,dev\\,prod"', function(error, stdout, stderr) {
expect(stdout).to.contain('0 warn');
expect(stdout).to.contain('0 crit');
expect(stderr).to.be.empty;
done();
});
}).timeout(5000);

it('parameters of the List<Number> type should accept lists as values', (done) => {
exec('node lib/index.js validate testData/valid/yaml/parameters_type_list_number.yaml --parameters SomeParam="1\\,2\\,3"', function(error, stdout, stderr) {
expect(stdout).to.contain('0 warn');
expect(stdout).to.contain('0 crit');
expect(stderr).to.be.empty;
done();
});
}).timeout(5000);
});

});
11 changes: 11 additions & 0 deletions testData/valid/yaml/parameters_type_commadelimitedlist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Parameters:
SomeParam:
Type: CommaDelimitedList
Resources:
bucket_name:
Type: AWS::S3::Bucket
Properties:
BucketName:
Fn::Select:
- 2
- Ref: SomeParam
11 changes: 11 additions & 0 deletions testData/valid/yaml/parameters_type_list_number.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Parameters:
SomeParam:
Type: List<Number>
Resources:
bucket_name:
Type: AWS::S3::Bucket
Properties:
BucketName:
Fn::Select:
- 2
- Ref: SomeParam

0 comments on commit cfb6929

Please sign in to comment.