Skip to content

Commit

Permalink
Require Node.js 6 and update marked
Browse files Browse the repository at this point in the history
Closes #14
  • Loading branch information
sindresorhus committed Aug 8, 2018
1 parent 27d1bf7 commit d1fff12
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
@@ -1,2 +1 @@
* text=auto
*.js text eol=lf
* text=auto eol=lf
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,5 +1,5 @@
language: node_js
node_js:
- '10'
- '8'
- '6'
- '4'
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -10,7 +10,7 @@
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
"node": ">=6"
},
"scripts": {
"test": "xo && ava"
Expand All @@ -29,12 +29,13 @@
"html"
],
"dependencies": {
"marked": "^0.3.9",
"plugin-error": "^0.1.2",
"marked": "^0.4.0",
"plugin-error": "^1.0.1",
"through2": "^2.0.0"
},
"devDependencies": {
"ava": "*",
"p-event": "^2.1.0",
"vinyl": "^2.1.0",
"xo": "*"
}
Expand Down
28 changes: 14 additions & 14 deletions test.js
@@ -1,26 +1,26 @@
import test from 'ava';
import Vinyl from 'vinyl';
import m from '.';
import pEvent from 'p-event';
import markdown from '.';

test.cb('compiles Markdown to HTML', t => {
const stream = m();

stream.once('data', file => {
t.is(file.relative, 'fixture.html');
t.is(file.contents.toString(), '<p><em>foo</em></p>\n');
});

stream.on('end', t.end);
test('compiles Markdown to HTML', async t => {
const stream = markdown();
const dataPromise = pEvent(stream, 'data');

stream.end(new Vinyl({
path: 'fixture.md',
contents: Buffer.from('*foo*')
}));

const file = await dataPromise;

t.is(file.relative, 'fixture.html');
t.is(file.contents.toString(), '<p><em>foo</em></p>\n');
});

test('exposes the marked object', t => {
t.truthy(m.marked);
t.truthy(m.marked.Renderer);
t.truthy(m.marked.lexer);
t.truthy(m.marked.parser);
t.truthy(markdown.marked);
t.truthy(markdown.marked.Renderer);
t.truthy(markdown.marked.lexer);
t.truthy(markdown.marked.parser);
});

0 comments on commit d1fff12

Please sign in to comment.