Skip to content

Commit 5731b47

Browse files
Add .registerAlias() Test
1 parent 5cb0482 commit 5731b47

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/api/registerAlias.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
3+
const hljs = require('../../build');
4+
const should = require('should');
5+
6+
describe('.registerAlias()', () => {
7+
it('should get an existing language by alias', () => {
8+
hljs.registerAlias('jquery', {
9+
languageName: 'javascript'
10+
});
11+
const result = hljs.getLanguage('jquery');
12+
13+
result.should.be.instanceOf(Object);
14+
});
15+
16+
it('should get an existing language by aliases', () => {
17+
hljs.registerAlias(['jquery', 'jqueryui'], {
18+
languageName: 'javascript'
19+
});
20+
const result = hljs.getLanguage('jquery');
21+
22+
result.should.be.instanceOf(Object);
23+
});
24+
});

0 commit comments

Comments
 (0)