diff options
author | ache <ache@ache.one> | 2019-03-03 02:13:07 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2019-03-03 02:14:59 +0100 |
commit | 6f054ca562d847b49544d2cb6e24fc91abede082 (patch) | |
tree | 4a3db33251fc7c789cb77bb9b7544cdd60c851c1 /__tests__/index.js |
Init commit
Diffstat (limited to '__tests__/index.js')
-rw-r--r-- | __tests__/index.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/__tests__/index.js b/__tests__/index.js new file mode 100644 index 0000000..d1bb986 --- /dev/null +++ b/__tests__/index.js @@ -0,0 +1,22 @@ +'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: '<http://ache>', result: '<http://ache>\n'}, +]; + +testInfos.forEach(testInfo => { + test(testInfo.name, t => { + const {base} = testInfo; + const {result} = testInfo; + t.is(processor(base).contents, result); + }); +}); + |