array-changes-async
Advanced tools
Comparing version
@@ -117,2 +117,3 @@ /*global setTimeout */ | ||
diffItem.expected = expected[offset + index]; | ||
diffItem.expectedIndex = offset + index; | ||
} | ||
@@ -119,0 +120,0 @@ }); |
{ | ||
"name": "array-changes-async", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Array diffing", | ||
@@ -5,0 +5,0 @@ "main": "./lib/arrayChanges.js", |
@@ -307,2 +307,31 @@ /*global describe, it, setTimeout, Symbol*/ | ||
it('should report the expectedIndex of equal elements when arrays are identical', function () { | ||
var a = [ 1, 2 ]; | ||
var b = [ 1, 2 ]; | ||
return expect(promiseArrayChanges(a, b, function (a, b, aIndex, bIndex, callback) { | ||
callback(a === b); | ||
}, function (a, b, aIndex, bIndex, callback) { | ||
callback(a === b); | ||
}), 'when fulfilled', 'to satisfy', [ | ||
{ type: 'equal', actualIndex: 0, expectedIndex: 0, value: 1, expected: 1 }, | ||
{ type: 'equal', actualIndex: 1, expectedIndex: 1, value: 2, expected: 2 } | ||
] | ||
); | ||
}); | ||
it('should report the expectedIndex of equal elements when items are offset', function () { | ||
var a = [ 1, 2 ]; | ||
var b = [ 0, 1, 2 ]; | ||
return expect(promiseArrayChanges(a, b, function (a, b, aIndex, bIndex, callback) { | ||
callback(a === b); | ||
}, function (a, b, aIndex, bIndex, callback) { | ||
callback(a === b); | ||
}), 'when fulfilled', 'to satisfy', [ | ||
{ type: 'insert', value: 0 }, | ||
{ type: 'equal', actualIndex: 0, expectedIndex: 1, value: 1, expected: 1 }, | ||
{ type: 'equal', actualIndex: 1, expectedIndex: 2, value: 2, expected: 2 } | ||
] | ||
); | ||
}); | ||
if (typeof Symbol !== 'undefined') { | ||
@@ -309,0 +338,0 @@ it('should diff arrays that have Symbol property names', function () { |
@@ -1,2 +0,1 @@ | ||
var Babel = require('babel'); | ||
@@ -13,11 +12,6 @@ module.exports = function (wallaby) { | ||
runner: 'node' | ||
}, | ||
compilers: { | ||
'**/*.js': wallaby.compilers.babel({ | ||
babel: Babel | ||
}) | ||
} | ||
}; | ||
}; |
Sorry, the diff of this file is not supported yet
80624
21.34%20
5.26%587
3.89%