From 350d1e89786bce273404aca5e15dc98506a65728 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 6 Dec 2011 10:23:58 +0000 Subject: [PATCH] util.inspect to dump tokens It gets a better output over JSON.stringify since inspect nicely indent the object/array dump. Makes it easier to read for humans. --- tests/parser/parserTests.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/parser/parserTests.js b/tests/parser/parserTests.js index 4c17f48b46..1e31470229 100644 --- a/tests/parser/parserTests.js +++ b/tests/parser/parserTests.js @@ -18,6 +18,7 @@ var fs = require('fs'), path = require('path'), jsDiff = require('diff'), colors = require('colors'), + util = require( 'util' ), HTML5 = require('html5').HTML5; // Name of file used to cache the parser tests cases @@ -386,7 +387,9 @@ function processTest(item) { }); //var res = es.HtmlSerializer.stringify(tokens,environment); //console.log(JSON.stringify(tokens)); - + //Slightly better token output debugging: + //console.log( util.inspect( tokens, false, null ).yellow); + // Build a DOM tree from tokens using the HTML tree // builder/parser. processTokens(tokens, tokenizer);