aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2019-01-07 13:47:32 +0100
committerache <ache@ache.one>2019-01-07 13:47:32 +0100
commit98d5fdc1d366511b30f0598c3b4c52256de333be (patch)
treeac0adcffaa5e0e81494d614db4d4c6de22bc4147
parentUpdate dependancies (diff)
Test style code
-rw-r--r--__tests__/index.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/__tests__/index.js b/__tests__/index.js
index b0fb9a3..e2a618e 100644
--- a/__tests__/index.js
+++ b/__tests__/index.js
@@ -1,3 +1,7 @@
+'use strict';
+
+import plugin from '..';
+
import unified from 'unified';
import test from 'ava';
@@ -5,9 +9,7 @@ import raw from 'rehype-raw';
import reParse from 'remark-parse';
import stringify from 'rehype-stringify';
import remark2rehype from 'remark-rehype';
-import parse5 from 'parse5';
-
-import plugin from '..';
+import {parse} from 'parse5';
const dom5 = require('dom5');
@@ -26,8 +28,6 @@ const renderRaw = text => unified()
.use(stringify)
.processSync(text);
-const parse = cont => parse5.parse(cont);
-
test('line-input-simple', t => {
const {contents} = render('[__here__]');
t.deepEqual(parse(contents), parse('<p><input type="text" placeholder="here"></p>'));
@@ -121,40 +121,40 @@ test('not a line-input', t => {
const {contents} = renderRaw(`
[_ text line_______]`);
- t.is(null, dom5.query(parse5.parse(contents), dom5.predicates.hasTagName('input')));
+ t.is(null, dom5.query(parse(contents), dom5.predicates.hasTagName('input')));
});
test('not a line-input 2', t => {
const {contents} = renderRaw(`
[___]`);
- t.is(null, dom5.query(parse5.parse(contents), dom5.predicates.hasTagName('input')));
+ t.is(null, dom5.query(parse(contents), dom5.predicates.hasTagName('input')));
});
test('not a line-input 3', t => {
const {contents} = renderRaw(`
[______ Not a line input
_______] some text`);
- t.is(null, dom5.query(parse5.parse(contents), dom5.predicates.hasTagName('input')));
+ t.is(null, dom5.query(parse(contents), dom5.predicates.hasTagName('input')));
});
test('not a line-input 4', t => {
const {contents} = renderRaw(`
[___ Not a line input ]`);
- t.is(null, dom5.query(parse5.parse(contents), dom5.predicates.hasTagName('input')));
+ t.is(null, dom5.query(parse(contents), dom5.predicates.hasTagName('input')));
});
test('is a line-input', t => {
const {contents} = renderRaw('a[___This is a text___]qsd');
- t.not(null, dom5.query(parse5.parse(contents), dom5.predicates.hasTagName('input')));
+ t.not(null, dom5.query(parse(contents), dom5.predicates.hasTagName('input')));
});
test('is line-input 2', t => {
const {contents} = renderRaw(`
[____]`);
- t.not(null, dom5.query(parse5.parse(contents), dom5.predicates.hasTagName('input')));
+ t.not(null, dom5.query(parse(contents), dom5.predicates.hasTagName('input')));
});