aboutsummaryrefslogtreecommitdiff
path: root/__tests__/index.js
diff options
context:
space:
mode:
Diffstat (limited to '__tests__/index.js')
-rw-r--r--__tests__/index.js22
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);
+ });
+});
+