UNPKG

moy-dom

Version:

A flexiable Virtual DOM library for building modern web interface.

15 lines (13 loc) 321 B
import move from '../../src/listDiff/move' describe('test for move', () => { test('simple test', () => { const list = [1, 3, 2, 4], changes = [] move(2, 1, list, changes) expect(list).toEqual([1, 2, 3, 4]) expect(changes).toEqual([{ type: 1, toIndex: 2, fromIndex: 1, }]) }) })