forked from highlightjs/highlight.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52ad15c
commit 72d2ba6
Showing
4 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict'; | ||
|
||
let hljs = require('../../build'); | ||
let should = require('should'); | ||
|
||
describe('.autoDetection()', function() { | ||
it('should get an existing language', function() { | ||
const result = hljs.autoDetection('python'); | ||
|
||
result.should.be.instanceOf(Object); | ||
}); | ||
|
||
it('should get an existing language by alias', function() { | ||
const result = hljs.autoDetection('py'); | ||
|
||
result.should.be.instanceOf(Object); | ||
}); | ||
|
||
it('should be case insensitive', function() { | ||
const result = hljs.autoDetection('pYTHOn'); | ||
|
||
result.should.be.instanceOf(Object); | ||
}); | ||
|
||
it('should return undefined', function() { | ||
const result = hljs.autoDetection('-impossible-'); | ||
|
||
should.strictEqual(result, undefined); | ||
}); | ||
|
||
it('should not break on undefined', function() { | ||
const result = hljs.autoDetection(undefined); | ||
|
||
should.strictEqual(result, undefined); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters