Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ describe('last', function() {
assert.strictEqual(last(['a', 'b', 'c', 'd', 'e', 'f'], 1), 'f');
});

it('should the last n elements of the array:', function() {
it('should return the last n elements of the array:', function() {
assert.deepEqual(last(['a', 'b', 'c', 'd', 'e', 'f'], 3), ['d', 'e', 'f']);
});

it('should not include undefined in the returned elements of the array:', function() {
assert.deepEqual(last(['a', 'b', 'c', 'd', 'e', 'f'], 7), ['a', 'b', 'c', 'd', 'e', 'f']);
});

it('should return null if the array has no elements', function() {
assert.strictEqual(last([]), null);
assert.strictEqual(last([], 3), null);
Expand Down