mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-13 03:02:49 +00:00
Added files
This commit is contained in:
29
mongoui/mongoui-master/node_modules/highlight/examples/should-load-js-only.js
generated
vendored
Normal file
29
mongoui/mongoui-master/node_modules/highlight/examples/should-load-js-only.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var Highlight = require("../lib/highlight.js")
|
||||
, assert = require('assert')
|
||||
, fs = require('fs')
|
||||
, reHasAnnotations = /\sclass="[\w-]+"/
|
||||
;
|
||||
|
||||
function runTest(err) {
|
||||
|
||||
assert.ok(!err, err && err.message);
|
||||
assert.strictEqual(1, Highlight.loadedLanguages.length, 'more than one language is loaded: ' + Highlight.loadedLanguages);
|
||||
assert.strictEqual('javascript', Highlight.loadedLanguages[0], 'javascript is the language');
|
||||
|
||||
fs.readFile('./example.js.html', 'utf8', function (err, text) {
|
||||
var annotated
|
||||
;
|
||||
|
||||
assert.ok(!err, 'threw error reading example.js.html');
|
||||
annotated = Highlight.highlight(text, ' ', true);
|
||||
assert.ok(annotated.match(reHasAnnotations));
|
||||
//console.log(annotated);
|
||||
console.info('[PASS] source is annotated');
|
||||
});
|
||||
}
|
||||
|
||||
Highlight.init(runTest, ['javascript']);
|
||||
}());
|
||||
Reference in New Issue
Block a user