Skip to content

Commit 62d64e5

Browse files
committed
test(urlEmbed): The unit test for url embedding class added
1 parent 76e8173 commit 62d64e5

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

test/index.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ require('./modules/utils.test');
33

44
require('./modules/emoticons/emoji.test');
55
require('./modules/emoticons/smiley.test');
6+
7+
require('./modules/url.test.js');

test/modules/url.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const Url = require('../../src/modules/url.es6');
2+
const expect = require('chai').expect;
3+
4+
5+
const options = {
6+
linkExclude : [],
7+
linkTarget : '_blank'
8+
};
9+
const string = new Url('The url is http://rkritesh.in', options);
10+
11+
describe('Replace url by anchor tags', function(){
12+
"use strict";
13+
it('should return a valid anchor tag by replacing the link', function(){
14+
expect(string.process()).to.equal(
15+
`The url is <a href="http://rkritesh.in" target="_blank">http://rkritesh.in</a>`
16+
)
17+
});
18+
});

0 commit comments

Comments
 (0)