Skip to content

Commit

Permalink
Failing test for guard clause if airport is full
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhodine-orleans-lindsay committed Jan 31, 2020
1 parent df20c8a commit fe1b919
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions JavaScriptAirport/spec/airportSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,13 @@ describe('Airport', function(){
it('sets default capacity', function(){
expect(airport.capacity).toEqual(20)
});

it('raises an error if full', function(){
airport.capacity = 1;
airport.clearForLanding(plane);
expect(function(){
airport.clearForLanding(plane);
}).toThrowError("Airport Full!");
});
});
});
5 changes: 3 additions & 2 deletions JavaScriptAirport/src/airport.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use strict'
class Airport{
constructor(){
this._runway = []
}
this._runway = [];
this.capacity = 20;
};

planes(){
return this._runway;
Expand Down

0 comments on commit fe1b919

Please sign in to comment.