From 66c13f1a76915e502d22ace1198cb7d8789a668b Mon Sep 17 00:00:00 2001 From: ache Date: Wed, 7 Feb 2018 03:02:03 +0100 Subject: more tests --- __tests__/__snapshots__/index.js.md | 15 ++++++++- __tests__/__snapshots__/index.js.snap | Bin 155 -> 204 bytes __tests__/index.js | 59 +++++++++++++++++++++++++++++----- 3 files changed, 65 insertions(+), 9 deletions(-) diff --git a/__tests__/__snapshots__/index.js.md b/__tests__/__snapshots__/index.js.md index 7c17a23..5bcf487 100644 --- a/__tests__/__snapshots__/index.js.md +++ b/__tests__/__snapshots__/index.js.md @@ -15,4 +15,17 @@ Generated by [AVA](https://ava.li). > Snapshot 1 - '

This is a text :

' + '

This is a text :

+ +## snapshot raw + +> Snapshot 1 + + `

This is a text :

␊ + ` + +## snapshot simple + +> Snapshot 1 + + '

This is a text :

' \ No newline at end of file diff --git a/__tests__/__snapshots__/index.js.snap b/__tests__/__snapshots__/index.js.snap index f072c32..8bfbb1f 100644 Binary files a/__tests__/__snapshots__/index.js.snap and b/__tests__/__snapshots__/index.js.snap differ diff --git a/__tests__/index.js b/__tests__/index.js index 27150a5..b81991d 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -25,24 +25,67 @@ const renderRaw = text => unified() .use(stringify) .processSync(text); -test('text simple', t => { +test('snapshot simple', t => { const {contents} = render(file(join(__dirname, 'text.md'))); t.snapshot(contents); }); -test('text raw', t => { +test('snapshot raw', t => { const {contents} = renderRaw(file(join(__dirname, 'text.md'))); t.snapshot(contents); }); -test.todo('empty'); -test.todo('empty raw'); +test('emty', t => { + const {contents} = render('[____\n____]'); + t.is(contents, ''); +}); + +test('emty-raw', t => { + const {contents} = renderRaw('[____\n____]'); + t.is(contents, ''); +}); + +test('simple', t => { + const {contents} = render('[____\nHere some text\n____]'); + t.is(contents, ''); +}); + +test('simple-raw', t => { + const {contents} = renderRaw('[____\nHere some text\n____]'); + t.is(contents, ''); +}); + +test('long', t => { + const {contents} = render(` +[_______ -test.todo('simple'); -test.todo('simple raw'); +Here some awesome text ! +With severale lines, ... -test.todo('long'); -test.todo('long raw'); +a good text area +_______]`); + t.is(contents, ``); +}); + +test('long-raw', t => { + const {contents} = renderRaw(` +[_______ + +Here some awesome text ! +With severale lines, ... + +a good text area +_______]`); + t.is(contents, ``); +}); test.todo('id text'); test.todo('class'); -- cgit v1.2.3