'use strict'; import remark from 'remark'; import plugin from '..'; import test from 'ava'; const processor = str => remark().use(plugin).processSync(str); const testInfos = [ {name: 'example', base: '[link](url)', result: '[link](/url)\n'}, {name: 'local link', base: '[link](/url)', result: '[link](/url)\n'}, {name: 'auto link', base: '', result: '\n'}, ]; testInfos.forEach(testInfo => { test(testInfo.name, t => { const {base} = testInfo; const {result} = testInfo; t.is(processor(base).contents, result); }); });