From 59c8cab6a8cc9258a0f6442299ea6368ce11b306 Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 29 Apr 2018 10:13:51 +0200 Subject: Fix the old bug with raw interpretation --- __tests__/__snapshots__/index.js.md | 18 +++------------- __tests__/__snapshots__/index.js.snap | Bin 204 -> 167 bytes __tests__/index.js | 39 +++++++++++++++++++--------------- 3 files changed, 25 insertions(+), 32 deletions(-) (limited to '__tests__') diff --git a/__tests__/__snapshots__/index.js.md b/__tests__/__snapshots__/index.js.md index 5bcf487..881259a 100644 --- a/__tests__/__snapshots__/index.js.md +++ b/__tests__/__snapshots__/index.js.md @@ -4,28 +4,16 @@ The actual snapshot is saved in `index.js.snap`. Generated by [AVA](https://ava.li). -## text raw - -> Snapshot 1 - - `

This is a text :

␊ - ` - -## text simple - -> Snapshot 1 - - '

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 + `

this is a text :

␊ + ` diff --git a/__tests__/__snapshots__/index.js.snap b/__tests__/__snapshots__/index.js.snap index 8bfbb1f..5e0f63c 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 e37b64f..38a3dbf 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -27,7 +27,7 @@ const renderRaw = text => unified() test('snapshot simple', t => { const {contents} = render(file(join(__dirname, 'text.md'))); - t.snapshot(contents); + t.snapshot(contents.toLowerCase()); }); test('snapshot raw', t => { @@ -37,36 +37,36 @@ test('snapshot raw', t => { test('emty', t => { const {contents} = render('[____\n____]'); - t.is(contents, ''); + t.is(contents.toLowerCase(), ''); }); test('emty-raw', t => { const {contents} = renderRaw('[____\n____]'); - t.is(contents, ''); + t.is(contents.toLowerCase(), ''); }); test('simple', t => { const {contents} = render('[____\nHere some text\n____]'); - t.is(contents, ''); + t.is(contents.toLowerCase(), ''); }); test('simple-raw', t => { const {contents} = renderRaw('[____\nHere some text\n____]'); - t.is(contents, ''); + t.is(contents.toLowerCase(), ''); }); test('long', t => { const {contents} = render(` [_______ -Here some awesome text ! -With severale lines, ... +here some awesome text ! +with severale lines, ... a good text area _______]`); - t.is(contents, ``); }); @@ -75,14 +75,14 @@ test('long-raw', t => { const {contents} = renderRaw(` [_______ -Here some awesome text ! -With severale lines, ... +here some awesome text ! +with severale lines, ... a good text area _______]`); - t.is(contents, ``); }); @@ -90,9 +90,14 @@ a good text area`); test('not a text-area', t => { const {contents} = renderRaw(` [_______some text -Oups bad-formated text area +oups bad-formated text area _______]`); - t.notRegex(contents, /textarea/); + t.notRegex(contents.toLowerCase(), /textarea/); +}); + +test('simple-raw2', t => { + const {contents} = renderRaw('[____\nHere some text\n____]\n\n
Yeah !
'); + t.is(contents.toLowerCase(), ''); }); test.todo('id text'); -- cgit v1.2.3