Преглед на файлове

Add a test to check that the new and original methods both work

tags/3.2.1
Morgan Harris преди 2 години
родител
ревизия
bb8b54a3bb
променени са 1 файла, в които са добавени 15 реда и са изтрити 0 реда
  1. 15
    0
      spec/spec/types/List.js

+ 15
- 0
spec/spec/types/List.js Целия файл

@@ -82,6 +82,21 @@ describe('List.js', () => {
List.extend([ 'unshift' ])
expect(new List().unshift).toEqual(any(Function))
expect(new List().$unshift).toEqual(Array.prototype.unshift)

// Check that it works!
const sourceArray = [
{ 'unshift': () => 1 },
{ 'unshift': () => 2 },
{ 'unshift': () => 3 }
];
const list = new List(sourceArray)

expect(list).toEqual(sourceArray)
expect(list.unshift(0)).toEqual([1,2,3])

expect(list.$unshift(0)).toEqual(4)
expect(list).toEqual([0].concat(sourceArray))

delete List.prototype.unshift;
});


Loading…
Отказ
Запис