The general idea across all testing frameworks is to allow developers to write code that would specify the behavior of a function or module or class.
Tesing one function at a time is vulnerable to false negatives and false positives.
Why do we test?
How We Test
Assertion Libraries : Backbone of written tests, the code that we use to write our tests.
Domain Specific Language : Refers to a computer language specialized for a particular purpose
What do we Test?
The Testing Pyramid
Unit Tests : The smallest unit of testing.
Integration Tests : Test the interactions between two pieces of your application.
End to End : Closest automated tests come to testing the actual user experience of your application.
Reading Tests
describe("avgValue()", function () {
it("should return the average of an array of numbers", function () {
assert.equal(avgValue([10, 20]), 15);
});
});
Motivations for TDD