aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2018-02-07 03:02:03 +0100
committerache <ache@ache.one>2018-02-07 03:02:03 +0100
commit66c13f1a76915e502d22ace1198cb7d8789a668b (patch)
tree3029d13b1b45646c13c6363f620324e73a6ac76e
parentadd tests with AVA (diff)
more tests
-rw-r--r--__tests__/__snapshots__/index.js.md15
-rw-r--r--__tests__/__snapshots__/index.js.snapbin155 -> 204 bytes
-rw-r--r--__tests__/index.js59
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
- '<p>This is a text : </p>'
+ '<p>This is a text : </p>
+
+## snapshot raw
+
+> Snapshot 1
+
+ `<p>This is a text : </p>␊
+ <textarea></textarea>`
+
+## snapshot simple
+
+> Snapshot 1
+
+ '<p>This is a text : </p>' \ No newline at end of file
diff --git a/__tests__/__snapshots__/index.js.snap b/__tests__/__snapshots__/index.js.snap
index f072c32..8bfbb1f 100644
--- a/__tests__/__snapshots__/index.js.snap
+++ b/__tests__/__snapshots__/index.js.snap
Binary files 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, '<textarea></textarea>');
+});
+
+test('emty-raw', t => {
+ const {contents} = renderRaw('[____\n____]');
+ t.is(contents, '<textarea></textarea>');
+});
+
+test('simple', t => {
+ const {contents} = render('[____\nHere some text\n____]');
+ t.is(contents, '<textarea>Here some text</textarea>');
+});
+
+test('simple-raw', t => {
+ const {contents} = renderRaw('[____\nHere some text\n____]');
+ t.is(contents, '<textarea>Here some text</textarea>');
+});
+
+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, `<textarea>
+Here some awesome text !
+With severale lines, ...
+
+a good text area</textarea>`);
+});
+
+test('long-raw', t => {
+ const {contents} = renderRaw(`
+[_______
+
+Here some awesome text !
+With severale lines, ...
+
+a good text area
+_______]`);
+ t.is(contents, `<textarea>
+Here some awesome text !
+With severale lines, ...
+
+a good text area</textarea>`);
+});
test.todo('id text');
test.todo('class');