File: ansi.js

package info (click to toggle)
node-columnify 1.5.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 29,684 kB
  • sloc: makefile: 9
file content (22 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var test = require('tape')
var fs = require('fs')
var chalk = require('chalk')
// required when running inside faucet etc
// as chalk will detect output is not a tty
// and disable color for you automatically
chalk.enabled = true

var columnify =  require('../')

var data = {
  "mocha@1.18.2": chalk.yellow('3'),
  "commander@2.0.0": chalk.green('1'),
  "debug@0.8.1": chalk.red('6')
}

//test('width calculated correctly even if ansi colors used.', function(t) {
//  t.plan(1)
//  var expected = fs.readFileSync(__dirname + '/ansi-expected.txt', 'utf8')
//  var actual = columnify(data)
//  t.equal(actual.trim(), expected.trim())
//})