--
This commit is contained in:
parent
24f3d27984
commit
6b60015c02
9588 changed files with 1149251 additions and 49 deletions
22
node_modules/cardinal/test/cardinal-highlight-json-file-async.js
generated
vendored
Normal file
22
node_modules/cardinal/test/cardinal-highlight-json-file-async.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
'use strict';
|
||||
/*jshint asi: true*/
|
||||
|
||||
var test = require('tap').test
|
||||
, util = require('util')
|
||||
, path = require('path')
|
||||
, cardinal = require('..')
|
||||
|
||||
function inspect (obj) {
|
||||
return console.log(util.inspect(obj, false, 5, false))
|
||||
}
|
||||
|
||||
var file = path.join(__dirname, 'fixtures/json.json');
|
||||
|
||||
test('without custom theme', function (t) {
|
||||
cardinal.highlightFile(file, function (err, highlighted) {
|
||||
|
||||
t.equals(null, err, 'no error');
|
||||
t.equals(highlighted, '\u001b[33m{\u001b[39m\u001b[32m"foo"\u001b[39m\u001b[93m:\u001b[39m\u001b[92m"bar"\u001b[39m\u001b[32m,\u001b[39m\u001b[32m"baz"\u001b[39m\u001b[93m:\u001b[39m\u001b[92m"quux"\u001b[39m\u001b[32m,\u001b[39m\u001b[32m"bam"\u001b[39m\u001b[93m:\u001b[39m\u001b[90mnull\u001b[39m\u001b[33m}\u001b[39m');
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue