From 145424ab245350a4a6eec1adab8d57402677530e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 10 Jan 2015 17:27:26 -0800 Subject: Removed ansi from js source tree. Test suite will now use ansi if the package is installed, otherwise skip it. --- js/test.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'js/test.js') diff --git a/js/test.js b/js/test.js index 6cb7c98..a6184b3 100755 --- a/js/test.js +++ b/js/test.js @@ -3,8 +3,26 @@ var fs = require('fs'); var commonmark = require('./lib/index.js'); -var ansi = require('./ansi/ansi'); -var cursor = ansi(process.stdout); +var ansi; +var cursor; + +try { + ansi = require('ansi'); + cursor = ansi(process.stdout); +} +catch(err) { + var noOp = function() { return this; }; + cursor = { + write: function (s) { + process.stdout.write(s); + return this; + }, + green: noOp, + red: noOp, + cyan: noOp, + reset: noOp, + }; +} var writer = new commonmark.HtmlRenderer(); var reader = new commonmark.DocParser(); -- cgit v1.2.3