File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 11export interface IShardProps {
2+ /**
3+ * The CIDR block for a shard.
4+ */
5+ readonly cidr : string ;
26 /**
37 * The AWS region for a shard.
48 */
@@ -17,10 +21,12 @@ export interface IShard extends IShardProps {
1721}
1822
1923export abstract class Shard implements IShard {
24+ readonly cidr : string ;
2025 readonly region : string ;
2126 readonly number : number ;
2227
2328 constructor ( props : IShardProps ) {
29+ this . cidr = props . cidr ;
2430 this . region = props . region ;
2531 this . number = props . number ;
2632 }
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ describe('NamedEnv', () => {
4848
4949 describe ( 'NamedEnvFactory' , ( ) => {
5050 const shard : IShard = {
51+ cidr : 'fakeCidr' ,
5152 region : 'us-west-2' ,
5253 name : 'TestShard' ,
5354 number : 1 ,
Original file line number Diff line number Diff line change @@ -7,14 +7,17 @@ class TestShardImpl extends Shard {
77 }
88}
99
10- const testShardProps : IShardProps = { region : 'us-west-2' , number : 1 } ;
10+ const testShardProps : IShardProps = { cidr : 'fakeCidr' , region : 'us-west-2' , number : 1 } ;
1111
1212let shard : IShard ;
1313describe ( 'Shard' , ( ) => {
1414 beforeEach ( ( ) => {
1515 shard = new TestShardImpl ( testShardProps ) ;
1616 } ) ;
1717
18+ it ( 'sets cidr correctly' , ( ) => {
19+ expect ( shard . cidr ) . toEqual ( testShardProps . cidr ) ;
20+ } ) ;
1821 it ( 'sets region correctly' , ( ) => {
1922 expect ( shard . region ) . toEqual ( testShardProps . region ) ;
2023 } ) ;
You can’t perform that action at this time.
0 commit comments