December 2017
Beginner
372 pages
10h 32m
English
To write our test case, let's first create a new file in the same folder where we have the custom sort code. Let's name our file custom-sort.pipe.spec.ts. The logic in our pipe function is based on two parameters: task array, and the sort boolean property. Based on the sort boolean property, we identify whether we should sort our task array or not. The sorting is based on the title property in our task object.
So, here's a list of some of the unit test cases we can use for our pipe function:
Read now
Unlock full access