-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
31 lines (26 loc) · 1.03 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*!
* markdown-link <https://github.com/jonschlinkert/markdown-link>
*
* Copyright (c) 2015 Jon Schlinkert.
* Licensed under the MIT license.
*/
'use strict';
/* deps:mocha */
var should = require('should');
var mdlink = require('./');
describe('markdown-link', function () {
it('should generate a markdown link:', function () {
mdlink('micromatch', 'https://github.com/jonschlinkert/micromatch').should.equal('[micromatch](https://github.com/jonschlinkert/micromatch)');
});
it('should support titles:', function () {
mdlink('micromatch', 'https://github.com/jonschlinkert/micromatch', 'Faster, drop-in replacement to minimatch.').should.equal('[micromatch](https://github.com/jonschlinkert/micromatch "Faster, drop-in replacement to minimatch.")');
});
it('should throw an error on bad args:', function () {
(function () {
mdlink();
}).should.throw('markdown-link expects anchor to be a string.');
(function () {
mdlink('foo');
}).should.throw('markdown-link expects href to be a string.');
});
});