These are my reading notes for Code Fellows
Name 3 advantages to Test Driven Development
In what case would you need to use beforeEach() or afterEach() in a test suite?
You would use beforeEach()
and afterEach()
for there is work that needs to be repeated for numerous tests. You could set up a temporary database with beforeEach()
and deconstruct it once all tests are done with afterEach()
.
These differ from beforeAll()
and afterAll()
in that it runs for each test that it contains, vs. just once at the start of the test.
(source)
What is one downside of Test Driven Development
You can write tests that find bugs, but catching those bugs is limited to your ability to write a thorough/well written test.
What’s the primary difference between ES6 Classes and Constructor/Prototype Classes?
“JavaScript splits the responsibility for instances into a constructor and a prototype. A constructor in JavaScript can be any function. Constructors are responsible for creating new instances.
“A prototype in JavaScript can be any object. Prototypes are responsible for defining the behaviour of instances. prototypes don’t have special methods or properties.” (source)
Why REST?
“One of the key advantages of REST APIs is that they provide a great deal of flexibility. Data is not tied to resources or methods, so REST can handle multiple types of calls, return different data formats and even change structurally with the correct implementation of hypermedia. This flexibility allows developers to build an API that meets your needs while also meeting the needs of very diverse customers.” (source)
“…a programming paradigm where programs are constructed by applying and composing functions.”
“The super keyword is used to access and call functions on an object’s parent.”
“The JavaScript this keyword refers to the object it belongs to.”
Test-driven development” refers to a style of programming in which three activities are tightly interwoven: coding, testing (in the form of writing unit tests) and design (in the form of refactoring).(source)
“Jest is a JavaScript testing framework designed to ensure correctness of any JavaScript codebase.”
Continuous integration (CI) is the practice of automating the integration of code changes from multiple contributors into a single software project. It’s a primary DevOps best practice, allowing developers to frequently merge code changes into a central repository where builds and tests then run. (source)
Representational state transfer (REST) is a software architectural style that was created to guide the design and development of the architecture for the World Wide Web (source)
…an abstract model that organizes elements of data and standardizes how they relate to one another and to the properties of real-world entities. (source)