Blame SOURCES/test.js

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