'use strict' const updateSection = require('..') const content = ['# Project', '', 'old', ''].join('\n') const section = ['', 'current', ''].join('\n') const updated = updateSection( content, section, (line) => line === '', (line) => line === '' ) if (!updated.includes('current')) throw new Error('section was not updated') console.log(updated)