1 |
|
2 | var assert = require('assert');
|
3 | var equal = require('assert-dir-equal');
|
4 | var Metalsmith = require('metalsmith');
|
5 | var markdown = require('..');
|
6 |
|
7 | describe('metalsmith-markdown', function(){
|
8 | it('should convert markdown files', function(done){
|
9 | Metalsmith('test/fixtures/basic')
|
10 | .use(markdown({
|
11 | smartypants: true
|
12 | }))
|
13 | .build(function(err){
|
14 | if (err) return done(err);
|
15 | equal('test/fixtures/basic/expected', 'test/fixtures/basic/build');
|
16 | done();
|
17 | });
|
18 | });
|
19 |
|
20 | it('should allow a "keys" option', function(done){
|
21 | Metalsmith('test/fixtures/keys')
|
22 | .use(markdown({
|
23 | keys: ['custom'],
|
24 | smartypants: true
|
25 | }))
|
26 | .build(function(err, files){
|
27 | if (err) return done(err);
|
28 | assert.equal('<p><em>a</em></p>\n', files['index.html'].custom);
|
29 | done();
|
30 | });
|
31 | });
|
32 | }); |
\ | No newline at end of file |