From 98d5fdc1d366511b30f0598c3b4c52256de333be Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 7 Jan 2019 13:47:32 +0100 Subject: Test style code --- __tests__/index.js | 22 +++++++++++----------- 1 file 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('

')); @@ -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'))); }); -- cgit v1.2.3