Port Object ;TLDR
Challenge
In this user story, a ship doesn't possess a port - it docks at one. Therefore, your domain model likely needs a new Port object.
Since our application now has more than one port, we need a way to differentiate between them, so lets assume a Port has a name.
There is also another doing word for a Ship: dock.
To complete this challenge, you will need to:
- Discuss with your classmates how the domain model might be added to in this scenario.
- Create a new test file, which should
describea newPortobject. - Create a new test spec to check the new
Portobject can be instantiated. - Write the code that makes this test pass.
- Create a new test spec to check the new
Portobject has anameproperty. - Write the code that makes this test pass.
- Refactor the
Shiptest suite so aShiptakes aPortobject instead of a string and check tests still pass. - Create a new test spec inside
Ship.test.jsto test adockmethod. - Write the code that makes this test pass.
- Add, commit with a meaningful message, and push to GitHub.