license import { elementVoid , patch , skipNode } from '../../index' ; const { expect } = chai ; describe ( 'skip' , ( ) => { let container ; let firstChild ; let lastChild ; beforeEach ( ( ) => { container = document . createElement ( 'div' ) ; container . innerHTML = '<div></div><span></span>' ; firstChild = container . firstChild ; lastChild = container . lastChild ; document . body . appendChild ( container ) ; } ) ; afterEach ( ( ) => { document . body . removeChild ( container ) ; } ) ; it ( 'should keep nodes that were skipped at the start' , ( ) => { patch ( container , ( ) => { skipNode ( ) ; elementVoid ( 'span' ) ; } ) ; expect ( container . firstChild ) . to . equal ( firstChild ) ; expect ( container . lastChild ) . to . equal ( lastChild ) ; } ) ; it ( 'should keep nodes that were skipped' , ( ) => { patch ( container , ( ) => { elementVoid ( 'div' ) ; skipNode ( ) ; } ) ; expect ( container . lastChild ) . to . equal ( lastChild ) ; } ) ; } ) ;