Projects
Mega:23.09
nodejs-ansi-styles
_service:tar_scm:test.js
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:test.js of Package nodejs-ansi-styles
'use strict'; var assert = require('assert'); var ansi = require('./'); // generates the screenshot Object.keys(ansi).forEach(function (el) { var style = ansi[el].open; if (el === 'reset' || el === 'hidden') { return; } if (/^bg[^B]/.test(el)) { style = ansi.black.open + style; } process.stdout.write(style + el + ansi.reset.open + ansi.reset.close + ' '); }); it('should return ANSI escape codes', function () { assert.equal(ansi.green.open, '\u001b[32m'); assert.equal(ansi.bgGreen.open, '\u001b[42m'); assert.equal(ansi.green.close, '\u001b[39m'); assert.equal(ansi.gray.open, ansi.grey.open); }); it('should group related codes into categories', function () { assert.equal(ansi.colors.magenta, ansi.magenta); assert.equal(ansi.bgColors.bgYellow, ansi.bgYellow); assert.equal(ansi.modifiers.bold, ansi.bold); }); it('groups should not be enumerable', function () { assert.equal(Object.keys(ansi).indexOf('modifiers'), -1); }); it('should not pollute other objects', function () { var obj1 = require('./'); var obj2 = require('./'); obj1.foo = true; assert.notEqual(obj1.foo, obj2.foo); });
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2