Blame SOURCES/test.js

71d86f
/*global describe */
71d86f
'use strict';
71d86f
var assert = require('assert');
71d86f
var ansi = require('./ansi-styles');
71d86f
71d86f
// generates the screenshot
71d86f
Object.keys(ansi).forEach(function (el) {
71d86f
	var style = ansi[el].open;
71d86f
71d86f
	if (el === 'reset') {
71d86f
		return;
71d86f
	}
71d86f
71d86f
	if (/^bg[^B]/.test(el)) {
71d86f
		style = ansi.black.open + style;
71d86f
	}
71d86f
71d86f
	process.stdout.write(style + el + ansi.reset.open + ansi.reset.close + ' ');
71d86f
});
71d86f
71d86f
describe('ansiStyles()', function () {
71d86f
	it('should return ANSI escape codes', function () {
71d86f
		assert.equal(ansi.green.open, '\x1b[32m');
71d86f
		assert.equal(ansi.bgGreen.open, '\x1b[42m');
71d86f
		assert.equal(ansi.green.close, '\x1b[39m');
71d86f
	});
71d86f
});