Skip to content

Commit

Permalink
Add .registerAlias() Test
Browse files Browse the repository at this point in the history
  • Loading branch information
taufik-nurrohman committed May 7, 2020
1 parent 5cb0482 commit 5731b47
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/api/registerAlias.js
@@ -0,0 +1,24 @@
'use strict';

const hljs = require('../../build');
const should = require('should');

describe('.registerAlias()', () => {
it('should get an existing language by alias', () => {
hljs.registerAlias('jquery', {
languageName: 'javascript'
});
const result = hljs.getLanguage('jquery');

result.should.be.instanceOf(Object);
});

it('should get an existing language by aliases', () => {
hljs.registerAlias(['jquery', 'jqueryui'], {
languageName: 'javascript'
});
const result = hljs.getLanguage('jquery');

result.should.be.instanceOf(Object);
});
});

0 comments on commit 5731b47

Please sign in to comment.