[Pkg-javascript-commits] [node-chalk] 01/01: clean up and turn on tests at build time

Paolo Greppi paolog-guest at moszumanska.debian.org
Mon Oct 30 17:49:43 UTC 2017


This is an automated email from the git hooks/post-receive script.

paolog-guest pushed a commit to branch wip/paolog
in repository node-chalk.

commit 06dcc1502aaea8ab8256d1c7d1a556a6cc1e176a
Author: Paolo Greppi <paolo.greppi at libpf.com>
Date:   Mon Oct 30 18:48:21 2017 +0100

    clean up and turn on tests at build time
    
    - patch tests to use mocha instead of ava
    - turn on build-time tests
    - refresh debian/control, install and watch based on those generated with npm2deb 0.2.7
    - remove obsolete file debian/README.source: no additional deps are managed via debian/watch anymore
---
 debian/README.source         |   8 -
 debian/changelog             |   3 +
 debian/control               |  38 +--
 debian/copyright             |   1 +
 debian/install               |   4 +-
 debian/patches/00-mocha.diff | 591 +++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series        |   1 +
 debian/rules                 |   6 +
 debian/watch                 |   3 +-
 9 files changed, 624 insertions(+), 31 deletions(-)

diff --git a/debian/README.source b/debian/README.source
deleted file mode 100644
index 5a66379..0000000
--- a/debian/README.source
+++ /dev/null
@@ -1,8 +0,0 @@
-This package depends on many tiny modules which are managed via debian/watch.
-To manage these dependencies, manually edit debian/watch so that each
-dependency has the correct version. Then you can use:
-
-uscan --download-current-version
-git-import-orig ../*.orig.tar.gz
-
-...to update to the latest upstream.
diff --git a/debian/changelog b/debian/changelog
index 48497d5..5804a9e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,11 @@
 node-chalk (2.1.0-1) unstable; urgency=medium
 
   * Team upload
+  [ Pirate Praveen ]
   * New upstream release
   * Drop all patches (tests are disabled as it needs ava)
+  [ Paolo Greppi ]
+  * Refresh debian/control, install and watch
 
  -- Pirate Praveen <praveen at debian.org>  Fri, 08 Sep 2017 12:55:42 +0530
 
diff --git a/debian/control b/debian/control
index 413f837..7c8f1ac 100644
--- a/debian/control
+++ b/debian/control
@@ -1,33 +1,33 @@
 Source: node-chalk
+Section: javascript
+Priority: optional
 Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
 Uploaders:
  Mathias Behrle <mbehrle at debian.org>,
-Section: web
-Priority: optional
 Build-Depends:
- debhelper (>= 9),
- mocha,
- node-ansi-styles,
- node-escape-string-regexp,
- node-has-ansi,
- node-strip-ansi,
- node-supports-color,
- nodejs,
+ debhelper (>= 9)
+ , dh-buildinfo
+ , nodejs
+ , mocha
+ , node-resolve-from
+ , node-ansi-styles
+ , node-escape-string-regexp
+ , node-has-ansi
+ , node-strip-ansi
+ , node-supports-color
 Standards-Version: 4.1.1
+Homepage: https://github.com/chalk/chalk#readme
+Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-chalk.git
 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-javascript/node-chalk.git
-Vcs-Git: https://anonscm.debian.org/cgit/pkg-javascript/node-chalk.git
-Homepage: https://github.com/sindresorhus/chalk
 
 Package: node-chalk
 Architecture: all
 Depends:
- node-ansi-styles,
- node-escape-string-regexp,
- node-has-ansi,
- node-strip-ansi,
- node-supports-color,
- nodejs,
- ${misc:Depends},
+ ${misc:Depends}
+ , nodejs
+ , node-ansi-styles (>= 3.1.0)
+ , node-escape-string-regexp (>= 1.0.5)
+ , node-supports-color (>= 4.0.0)
 Description: Terminal string styling for Node.js
  Chalk is a Node.js module which provides string styling via ANSI escape codes
  without extending String.prototype.
diff --git a/debian/copyright b/debian/copyright
index 4855b98..fb7484c 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -11,6 +11,7 @@ Files: debian/*
 Copyright: 2014, Andrew Kelley <superjoe30 at gmail.com>
            2015, Bas Couwenberg <sebastic at xs4all.nl>
            2016, Mathias Behrle <mbehrle at debian.org>
+           2017, Paolo Greppi <paolo.greppi at libpf.com>
 License: Expat
 
 License: Expat
diff --git a/debian/install b/debian/install
index 9ac50b5..4da30d4 100644
--- a/debian/install
+++ b/debian/install
@@ -1,3 +1,3 @@
-index.js     usr/lib/nodejs/chalk/
-templates.js     usr/lib/nodejs/chalk/
+templates.js usr/lib/nodejs/chalk/
+index.js usr/lib/nodejs/chalk/
 package.json usr/lib/nodejs/chalk/
diff --git a/debian/patches/00-mocha.diff b/debian/patches/00-mocha.diff
new file mode 100644
index 0000000..db62963
--- /dev/null
+++ b/debian/patches/00-mocha.diff
@@ -0,0 +1,591 @@
+Description: Change from ava to mocha as test runner (ava is not yet
+ available as a Debian package).
+ Something like:
+ sed -i 's/t => {/function() {/g' test.js 
+ sed -i 's/t.is/assert.equal/g' test.js 
+ sed -i 's/t.false\(/assert(!/g'
+ sed -i 's/t.true/assert/g'
+Forwarded: not-needed
+Author: Paolo Greppi <paolo.greppi at libpf.com>
+
+Index: node-chalk/test/chalk.js
+===================================================================
+--- node-chalk.orig/test/chalk.js
++++ node-chalk/test/chalk.js
+@@ -1,4 +1,4 @@
+-import test from 'ava';
++var assert = require('assert');
+ 
+ // Spoof supports-color
+ require('./_supports-color')(__dirname);
+@@ -8,93 +8,93 @@ const m = require('..');
+ console.log('TERM:', process.env.TERM || '[none]');
+ console.log('platform:', process.platform || '[unknown]');
+ 
+-test('don\'t add any styling when called as the base function', t => {
+-	t.is(m('foo'), 'foo');
++test('don\'t add any styling when called as the base function', function() {
++	assert.equal(m('foo'), 'foo');
+ });
+ 
+-test('support multiple arguments in base function', t => {
+-	t.is(m('hello', 'there'), 'hello there');
++test('support multiple arguments in base function', function() {
++	assert.equal(m('hello', 'there'), 'hello there');
+ });
+ 
+-test('style string', t => {
+-	t.is(m.underline('foo'), '\u001B[4mfoo\u001B[24m');
+-	t.is(m.red('foo'), '\u001B[31mfoo\u001B[39m');
+-	t.is(m.bgRed('foo'), '\u001B[41mfoo\u001B[49m');
++test('style string', function() {
++	assert.equal(m.underline('foo'), '\u001B[4mfoo\u001B[24m');
++	assert.equal(m.red('foo'), '\u001B[31mfoo\u001B[39m');
++	assert.equal(m.bgRed('foo'), '\u001B[41mfoo\u001B[49m');
+ });
+ 
+-test('support applying multiple styles at once', t => {
+-	t.is(m.red.bgGreen.underline('foo'), '\u001B[31m\u001B[42m\u001B[4mfoo\u001B[24m\u001B[49m\u001B[39m');
+-	t.is(m.underline.red.bgGreen('foo'), '\u001B[4m\u001B[31m\u001B[42mfoo\u001B[49m\u001B[39m\u001B[24m');
++test('support applying multiple styles at once', function() {
++	assert.equal(m.red.bgGreen.underline('foo'), '\u001B[31m\u001B[42m\u001B[4mfoo\u001B[24m\u001B[49m\u001B[39m');
++	assert.equal(m.underline.red.bgGreen('foo'), '\u001B[4m\u001B[31m\u001B[42mfoo\u001B[49m\u001B[39m\u001B[24m');
+ });
+ 
+-test('support nesting styles', t => {
+-	t.is(
++test('support nesting styles', function() {
++	assert.equal(
+ 		m.red('foo' + m.underline.bgBlue('bar') + '!'),
+ 		'\u001B[31mfoo\u001B[4m\u001B[44mbar\u001B[49m\u001B[24m!\u001B[39m'
+ 	);
+ });
+ 
+-test('support nesting styles of the same type (color, underline, bg)', t => {
+-	t.is(
++test('support nesting styles of the same type (color, underline, bg)', function() {
++	assert.equal(
+ 		m.red('a' + m.yellow('b' + m.green('c') + 'b') + 'c'),
+ 		'\u001B[31ma\u001B[33mb\u001B[32mc\u001B[33mb\u001B[31mc\u001B[39m'
+ 	);
+ });
+ 
+-test('reset all styles with `.reset()`', t => {
+-	t.is(m.reset(m.red.bgGreen.underline('foo') + 'foo'), '\u001B[0m\u001B[31m\u001B[42m\u001B[4mfoo\u001B[24m\u001B[49m\u001B[39mfoo\u001B[0m');
++test('reset all styles with `.reset()`', function() {
++	assert.equal(m.reset(m.red.bgGreen.underline('foo') + 'foo'), '\u001B[0m\u001B[31m\u001B[42m\u001B[4mfoo\u001B[24m\u001B[49m\u001B[39mfoo\u001B[0m');
+ });
+ 
+-test('support caching multiple styles', t => {
++test('support caching multiple styles', function() {
+ 	const red = m.red;
+ 	const green = m.green;
+ 	const redBold = red.bold;
+ 	const greenBold = green.bold;
+ 
+-	t.not(red('foo'), green('foo'));
+-	t.not(redBold('bar'), greenBold('bar'));
+-	t.not(green('baz'), greenBold('baz'));
++	assert.notEqual(red('foo'), green('foo'));
++	assert.notEqual(redBold('bar'), greenBold('bar'));
++	assert.notEqual(green('baz'), greenBold('baz'));
+ });
+ 
+-test('alias gray to grey', t => {
+-	t.is(m.grey('foo'), '\u001B[90mfoo\u001B[39m');
++test('alias gray to grey', function() {
++	assert.equal(m.grey('foo'), '\u001B[90mfoo\u001B[39m');
+ });
+ 
+-test('support variable number of arguments', t => {
+-	t.is(m.red('foo', 'bar'), '\u001B[31mfoo bar\u001B[39m');
++test('support variable number of arguments', function() {
++	assert.equal(m.red('foo', 'bar'), '\u001B[31mfoo bar\u001B[39m');
+ });
+ 
+-test('support falsy values', t => {
+-	t.is(m.red(0), '\u001B[31m0\u001B[39m');
++test('support falsy values', function() {
++	assert.equal(m.red(0), '\u001B[31m0\u001B[39m');
+ });
+ 
+-test('don\'t output escape codes if the input is empty', t => {
+-	t.is(m.red(), '');
+-	t.is(m.red.blue.black(), '');
++test('don\'t output escape codes if the inpuassert.equal empty', function() {
++	assert.equal(m.red(), '');
++	assert.equal(m.red.blue.black(), '');
+ });
+ 
+-test('keep Function.prototype methods', t => {
+-	t.is(m.grey.apply(null, ['foo']), '\u001B[90mfoo\u001B[39m');
+-	t.is(m.reset(m.red.bgGreen.underline.bind(null)('foo') + 'foo'), '\u001B[0m\u001B[31m\u001B[42m\u001B[4mfoo\u001B[24m\u001B[49m\u001B[39mfoo\u001B[0m');
+-	t.is(m.red.blue.black.call(null), '');
++test('keep Function.prototype methods', function() {
++	assert.equal(m.grey.apply(null, ['foo']), '\u001B[90mfoo\u001B[39m');
++	assert.equal(m.reset(m.red.bgGreen.underline.bind(null)('foo') + 'foo'), '\u001B[0m\u001B[31m\u001B[42m\u001B[4mfoo\u001B[24m\u001B[49m\u001B[39mfoo\u001B[0m');
++	assert.equal(m.red.blue.black.call(null), '');
+ });
+ 
+-test('line breaks should open and close colors', t => {
+-	t.is(m.grey('hello\nworld'), '\u001B[90mhello\u001B[39m\n\u001B[90mworld\u001B[39m');
++test('line breaks should open and close colors', function() {
++	assert.equal(m.grey('hello\nworld'), '\u001B[90mhello\u001B[39m\n\u001B[90mworld\u001B[39m');
+ });
+ 
+-test('properly convert RGB to 16 colors on basic color terminals', t => {
+-	t.is(new m.constructor({level: 1}).hex('#FF0000')('hello'), '\u001B[91mhello\u001B[39m');
+-	t.is(new m.constructor({level: 1}).bgHex('#FF0000')('hello'), '\u001B[101mhello\u001B[49m');
++test('properly convert RGB to 16 colors on basic color terminals', function() {
++	assert.equal(new m.constructor({level: 1}).hex('#FF0000')('hello'), '\u001B[91mhello\u001B[39m');
++	assert.equal(new m.constructor({level: 1}).bgHex('#FF0000')('hello'), '\u001B[101mhello\u001B[49m');
+ });
+ 
+-test('properly convert RGB to 256 colors on basic color terminals', t => {
+-	t.is(new m.constructor({level: 2}).hex('#FF0000')('hello'), '\u001B[38;5;196mhello\u001B[39m');
+-	t.is(new m.constructor({level: 2}).bgHex('#FF0000')('hello'), '\u001B[48;5;196mhello\u001B[49m');
+-	t.is(new m.constructor({level: 3}).bgHex('#FF0000')('hello'), '\u001B[48;2;255;0;0mhello\u001B[49m');
++test('properly convert RGB to 256 colors on basic color terminals', function() {
++	assert.equal(new m.constructor({level: 2}).hex('#FF0000')('hello'), '\u001B[38;5;196mhello\u001B[39m');
++	assert.equal(new m.constructor({level: 2}).bgHex('#FF0000')('hello'), '\u001B[48;5;196mhello\u001B[49m');
++	assert.equal(new m.constructor({level: 3}).bgHex('#FF0000')('hello'), '\u001B[48;2;255;0;0mhello\u001B[49m');
+ });
+ 
+-test('don\'t emit RGB codes if level is 0', t => {
+-	t.is(new m.constructor({level: 0}).hex('#FF0000')('hello'), 'hello');
+-	t.is(new m.constructor({level: 0}).bgHex('#FF0000')('hello'), 'hello');
++test('don\'t emit RGB codes if level is 0', function() {
++	assert.equal(new m.constructor({level: 0}).hex('#FF0000')('hello'), 'hello');
++	assert.equal(new m.constructor({level: 0}).bgHex('#FF0000')('hello'), 'hello');
+ });
+Index: node-chalk/test/constructor.js
+===================================================================
+--- node-chalk.orig/test/constructor.js
++++ node-chalk/test/constructor.js
+@@ -1,22 +1,22 @@
+-import test from 'ava';
++var assert = require('assert');
+ 
+ // Spoof supports-color
+ require('./_supports-color')(__dirname);
+ 
+ const m = require('..');
+ 
+-test('create an isolated context where colors can be disabled (by level)', t => {
++test('create an isolated context where colors can be disabled (by level)', function() {
+ 	const ctx = new m.constructor({level: 0, enabled: true});
+-	t.is(ctx.red('foo'), 'foo');
+-	t.is(m.red('foo'), '\u001B[31mfoo\u001B[39m');
++	assert.equal(ctx.red('foo'), 'foo');
++	assert.equal(m.red('foo'), '\u001B[31mfoo\u001B[39m');
+ 	ctx.level = 2;
+-	t.is(ctx.red('foo'), '\u001B[31mfoo\u001B[39m');
++	assert.equal(ctx.red('foo'), '\u001B[31mfoo\u001B[39m');
+ });
+ 
+-test('create an isolated context where colors can be disabled (by enabled flag)', t => {
++test('create an isolated context where colors can be disabled (by enabled flag)', function() {
+ 	const ctx = new m.constructor({enabled: false});
+-	t.is(ctx.red('foo'), 'foo');
+-	t.is(m.red('foo'), '\u001B[31mfoo\u001B[39m');
++	assert.equal(ctx.red('foo'), 'foo');
++	assert.equal(m.red('foo'), '\u001B[31mfoo\u001B[39m');
+ 	ctx.enabled = true;
+-	t.is(ctx.red('foo'), '\u001B[31mfoo\u001B[39m');
++	assert.equal(ctx.red('foo'), '\u001B[31mfoo\u001B[39m');
+ });
+Index: node-chalk/test/enabled.js
+===================================================================
+--- node-chalk.orig/test/enabled.js
++++ node-chalk/test/enabled.js
+@@ -1,35 +1,35 @@
+-import test from 'ava';
++var assert = require('assert');
+ 
+ // Spoof supports-color
+ require('./_supports-color')(__dirname);
+ 
+ const m = require('..');
+ 
+-test('don\'t output colors when manually disabled', t => {
++test('don\'t output colors when manually disabled', function() {
+ 	m.enabled = false;
+-	t.is(m.red('foo'), 'foo');
++	assert.equal(m.red('foo'), 'foo');
+ 	m.enabled = true;
+ });
+ 
+-test('enable/disable colors based on overall chalk enabled property, not individual instances', t => {
++test('enable/disable colors based on overall chalk enabled property, not individual instances', function() {
+ 	m.enabled = false;
+ 	const red = m.red;
+-	t.false(red.enabled);
++	assert(!red.enabled);
+ 	m.enabled = true;
+-	t.true(red.enabled);
++	assert(red.enabled);
+ 	m.enabled = true;
+ });
+ 
+-test('propagate enable/disable changes from child colors', t => {
++test('propagate enable/disable changes from child colors', function() {
+ 	m.enabled = false;
+ 	const red = m.red;
+-	t.false(red.enabled);
+-	t.false(m.enabled);
++	assert(!red.enabled);
++	assert(!m.enabled);
+ 	red.enabled = true;
+-	t.true(red.enabled);
+-	t.true(m.enabled);
++	assert(red.enabled);
++	assert(m.enabled);
+ 	m.enabled = false;
+-	t.false(red.enabled);
+-	t.false(m.enabled);
++	assert(!red.enabled);
++	assert(!m.enabled);
+ 	m.enabled = true;
+ });
+Index: node-chalk/test/level.js
+===================================================================
+--- node-chalk.orig/test/level.js
++++ node-chalk/test/level.js
+@@ -1,44 +1,39 @@
+-import path from 'path';
+-import test from 'ava';
+-import execa from 'execa';
++var path = require('path');
++var assert = require('assert');
+ 
+ // Spoof supports-color
+ require('./_supports-color')(__dirname);
+ 
+ const m = require('..');
+ 
+-test('don\'t output colors when manually disabled', t => {
++test('don\'t output colors when manually disabled', function() {
+ 	const oldLevel = m.level;
+ 	m.level = 0;
+-	t.is(m.red('foo'), 'foo');
++	assert.equal(m.red('foo'), 'foo');
+ 	m.level = oldLevel;
+ });
+ 
+-test('enable/disable colors based on overall chalk enabled property, not individual instances', t => {
++test('enable/disable colors based on overall chalk enabled property, not individual instances', function() {
+ 	const oldLevel = m.level;
+ 	m.level = 1;
+ 	const red = m.red;
+-	t.is(red.level, 1);
++	assert.equal(red.level, 1);
+ 	m.level = 0;
+-	t.is(red.level, m.level);
++	assert.equal(red.level, m.level);
+ 	m.level = oldLevel;
+ });
+ 
+-test('propagate enable/disable changes from child colors', t => {
++test('propagate enable/disable changes from child colors', function() {
+ 	const oldLevel = m.level;
+ 	m.level = 1;
+ 	const red = m.red;
+-	t.is(red.level, 1);
+-	t.is(m.level, 1);
++	assert.equal(red.level, 1);
++	assert.equal(m.level, 1);
+ 	red.level = 0;
+-	t.is(red.level, 0);
+-	t.is(m.level, 0);
++	assert.equal(red.level, 0);
++	assert.equal(m.level, 0);
+ 	m.level = 1;
+-	t.is(red.level, 1);
+-	t.is(m.level, 1);
++	assert.equal(red.level, 1);
++	assert.equal(m.level, 1);
+ 	m.level = oldLevel;
+ });
+-
+-test('disable colors if they are not supported', async t => {
+-	t.is(await execa.stdout('node', [path.join(__dirname, '_fixture')]), 'test');
+-});
+Index: node-chalk/test/template-literal.js
+===================================================================
+--- node-chalk.orig/test/template-literal.js
++++ node-chalk/test/template-literal.js
+@@ -1,83 +1,83 @@
+-import test from 'ava';
++var assert = require('assert');
+ 
+ // Spoof supports-color
+ require('./_supports-color')(__dirname);
+ 
+ const m = require('..');
+ 
+-test('return an empty string for an empty literal', t => {
++test('return an empty string for an empty literal', function() {
+ 	const ctx = m.constructor();
+-	t.is(ctx``, '');
++	assert.equal(ctx``, '');
+ });
+ 
+-test('return a regular string for a literal with no templates', t => {
++test('return a regular string for a literal with no templates', function() {
+ 	const ctx = m.constructor({level: 0});
+-	t.is(ctx`hello`, 'hello');
++	assert.equal(ctx`hello`, 'hello');
+ });
+ 
+-test('correctly perform template parsing', t => {
++test('correctly perform template parsing', function() {
+ 	const ctx = m.constructor({level: 0});
+-	t.is(ctx`{bold Hello, {cyan World!} This is a} test. {green Woo!}`,
++	assert.equal(ctx`{bold Hello, {cyan World!} This is a} test. {green Woo!}`,
+ 		ctx.bold('Hello,', ctx.cyan('World!'), 'This is a') + ' test. ' + ctx.green('Woo!'));
+ });
+ 
+-test('correctly perform template substitutions', t => {
++test('correctly perform template substitutions', function() {
+ 	const ctx = m.constructor({level: 0});
+ 	const name = 'Sindre';
+ 	const exclamation = 'Neat';
+-	t.is(ctx`{bold Hello, {cyan.inverse ${name}!} This is a} test. {green ${exclamation}!}`,
++	assert.equal(ctx`{bold Hello, {cyan.inverse ${name}!} This is a} test. {green ${exclamation}!}`,
+ 		ctx.bold('Hello,', ctx.cyan.inverse(name + '!'), 'This is a') + ' test. ' + ctx.green(exclamation + '!'));
+ });
+ 
+-test('correctly parse and evaluate color-convert functions', t => {
++test('correctly parse and evaluate color-convert functions', function() {
+ 	const ctx = m.constructor({level: 3});
+-	t.is(ctx`{bold.rgb(144,10,178).inverse Hello, {~inverse there!}}`,
++	assert.equal(ctx`{bold.rgb(144,10,178).inverse Hello, {~inverse there!}}`,
+ 		'\u001B[1m\u001B[38;2;144;10;178m\u001B[7mHello, ' +
+ 		'\u001B[27m\u001B[39m\u001B[22m\u001B[1m' +
+ 		'\u001B[38;2;144;10;178mthere!\u001B[39m\u001B[22m');
+ 
+-	t.is(ctx`{bold.bgRgb(144,10,178).inverse Hello, {~inverse there!}}`,
++	assert.equal(ctx`{bold.bgRgb(144,10,178).inverse Hello, {~inverse there!}}`,
+ 		'\u001B[1m\u001B[48;2;144;10;178m\u001B[7mHello, ' +
+ 		'\u001B[27m\u001B[49m\u001B[22m\u001B[1m' +
+ 		'\u001B[48;2;144;10;178mthere!\u001B[49m\u001B[22m');
+ });
+ 
+-test('properly handle escapes', t => {
++test('properly handle escapes', function() {
+ 	const ctx = m.constructor({level: 3});
+-	t.is(ctx`{bold hello \{in brackets\}}`,
++	assert.equal(ctx`{bold hello \{in brackets\}}`,
+ 		'\u001B[1mhello {in brackets}\u001B[22m');
+ });
+ 
+-test('throw if there is an unclosed block', t => {
++test('throw if there is an unclosed block', function() {
+ 	const ctx = m.constructor({level: 3});
+ 	try {
+-		console.log(ctx`{bold this shouldn't appear ever\}`);
++		console.log(ctx`{bold assert.equal shouldn't appear ever\}`);
+ 		t.fail();
+ 	} catch (err) {
+-		t.is(err.message, 'Chalk template literal is missing 1 closing bracket (`}`)');
++		assert.equal(err.message, 'Chalk template literal is missing 1 closing bracket (`}`)');
+ 	}
+ 
+ 	try {
+-		console.log(ctx`{bold this shouldn't {inverse appear {underline ever\} :) \}`);
++		console.log(ctx`{bold assert.equal shouldn't {inverse appear {underline ever\} :) \}`);
+ 		t.fail();
+ 	} catch (err) {
+-		t.is(err.message, 'Chalk template literal is missing 3 closing brackets (`}`)');
++		assert.equal(err.message, 'Chalk template literal is missing 3 closing brackets (`}`)');
+ 	}
+ });
+ 
+-test('throw if there is an invalid style', t => {
++test('throw if there is an invalid style', function() {
+ 	const ctx = m.constructor({level: 3});
+ 	try {
+-		console.log(ctx`{abadstylethatdoesntexist this shouldn't appear ever}`);
++		console.log(ctx`{abadstylethatdoesntexist assert.equal shouldn't appear ever}`);
+ 		t.fail();
+ 	} catch (err) {
+-		t.is(err.message, 'Unknown Chalk style: abadstylethatdoesntexist');
++		assert.equal(err.message, 'Unknown Chalk style: abadstylethatdoesntexist');
+ 	}
+ });
+ 
+-test('properly style multiline color blocks', t => {
++test('properly style multiline color blocks', function() {
+ 	const ctx = m.constructor({level: 3});
+-	t.is(
++	assert.equal(
+ 		ctx`{bold
+ 			Hello! This is a
+ 			${'multiline'} block!
+@@ -95,75 +95,75 @@ test('properly style multiline color blo
+ 	);
+ });
+ 
+-test('escape interpolated values', t => {
++test('escape interpolated values', function() {
+ 	const ctx = m.constructor({level: 0});
+-	t.is(ctx`Hello {bold hi}`, 'Hello hi');
+-	t.is(ctx`Hello ${'{bold hi}'}`, 'Hello {bold hi}');
++	assert.equal(ctx`Hello {bold hi}`, 'Hello hi');
++	assert.equal(ctx`Hello ${'{bold hi}'}`, 'Hello {bold hi}');
+ });
+ 
+-test('allow custom colors (themes) on custom contexts', t => {
++test('allow custom colors (themes) on custom contexts', function() {
+ 	const ctx = m.constructor({level: 3});
+ 	ctx.rose = ctx.hex('#F6D9D9');
+-	t.is(ctx`Hello, {rose Rose}.`, 'Hello, \u001B[38;2;246;217;217mRose\u001B[39m.');
++	assert.equal(ctx`Hello, {rose Rose}.`, 'Hello, \u001B[38;2;246;217;217mRose\u001B[39m.');
+ });
+ 
+-test('correctly parse newline literals (bug #184)', t => {
++test('correctly parse newline literals (bug #184)', function() {
+ 	const ctx = m.constructor({level: 0});
+-	t.is(ctx`Hello
++	assert.equal(ctx`Hello
+ {red there}`, 'Hello\nthere');
+ });
+ 
+-test('correctly parse newline escapes (bug #177)', t => {
++test('correctly parse newline escapes (bug #177)', function() {
+ 	const ctx = m.constructor({level: 0});
+-	t.is(ctx`Hello\nthere!`, `Hello\nthere!`);
++	assert.equal(ctx`Hello\nthere!`, `Hello\nthere!`);
+ });
+ 
+-test('correctly parse escape in parameters (bug #177 comment 318622809)', t => {
++test('correctly parse escape in parameters (bug #177 comment 318622809)', function() {
+ 	const ctx = m.constructor({level: 0});
+ 	const str = '\\';
+-	t.is(ctx`{blue ${str}}`, '\\');
++	assert.equal(ctx`{blue ${str}}`, '\\');
+ });
+ 
+-test('correctly parses unicode/hex escapes', t => {
++test('correctly parses unicode/hex escapes', function() {
+ 	const ctx = m.constructor({level: 0});
+-	t.is(ctx`\u0078ylophones are fo\x78y! {magenta.inverse \u0078ylophones are fo\x78y!}`,
++	assert.equal(ctx`\u0078ylophones are fo\x78y! {magenta.inverse \u0078ylophones are fo\x78y!}`,
+ 		'xylophones are foxy! xylophones are foxy!');
+ });
+ 
+-test('correctly parses string arguments', t => {
++test('correctly parses string arguments', function() {
+ 	const ctx = m.constructor({level: 3});
+-	t.is(ctx`{keyword('black').bold can haz cheezburger}`, '\u001B[38;2;0;0;0m\u001B[1mcan haz cheezburger\u001B[22m\u001B[39m');
+-	t.is(ctx`{keyword('blac\x6B').bold can haz cheezburger}`, '\u001B[38;2;0;0;0m\u001B[1mcan haz cheezburger\u001B[22m\u001B[39m');
+-	t.is(ctx`{keyword('blac\u006B').bold can haz cheezburger}`, '\u001B[38;2;0;0;0m\u001B[1mcan haz cheezburger\u001B[22m\u001B[39m');
++	assert.equal(ctx`{keyword('black').bold can haz cheezburger}`, '\u001B[38;2;0;0;0m\u001B[1mcan haz cheezburger\u001B[22m\u001B[39m');
++	assert.equal(ctx`{keyword('blac\x6B').bold can haz cheezburger}`, '\u001B[38;2;0;0;0m\u001B[1mcan haz cheezburger\u001B[22m\u001B[39m');
++	assert.equal(ctx`{keyword('blac\u006B').bold can haz cheezburger}`, '\u001B[38;2;0;0;0m\u001B[1mcan haz cheezburger\u001B[22m\u001B[39m');
+ });
+ 
+-test('throws if a bad argument is encountered', t => {
++test('throws if a bad argumenassert.equal encountered', function() {
+ 	const ctx = m.constructor({level: 3}); // Keep level at least 1 in case we optimize for disabled chalk instances
+ 	try {
+ 		console.log(ctx`{keyword(????) hi}`);
+ 		t.fail();
+ 	} catch (err) {
+-		t.is(err.message, 'Invalid Chalk template style argument: ???? (in style \'keyword\')');
++		assert.equal(err.message, 'Invalid Chalk template style argument: ???? (in style \'keyword\')');
+ 	}
+ });
+ 
+-test('throws if an extra unescaped } is found', t => {
++test('throws if an extra unescaped } is found', function() {
+ 	const ctx = m.constructor({level: 0});
+ 	try {
+ 		console.log(ctx`{red hi!}}`);
+ 		t.fail();
+ 	} catch (err) {
+-		t.is(err.message, 'Found extraneous } in Chalk template literal');
++		assert.equal(err.message, 'Found extraneous } in Chalk template literal');
+ 	}
+ });
+ 
+-test('should not parse upper-case escapes', t => {
++test('should not parse upper-case escapes', function() {
+ 	const ctx = m.constructor({level: 0});
+-	t.is(ctx`\N\n\T\t\X07\x07\U000A\u000A\U000a\u000a`, 'N\nT\tX07\x07U000A\u000AU000a\u000A');
++	assert.equal(ctx`\N\n\T\t\X07\x07\U000A\u000A\U000a\u000a`, 'N\nT\tX07\x07U000A\u000AU000a\u000A');
+ });
+ 
+-test('should properly handle undefined template interpolated values', t => {
++test('should properly handle undefined template interpolated values', function() {
+ 	const ctx = m.constructor({level: 0});
+-	t.is(ctx`hello ${undefined}`, 'hello undefined');
+-	t.is(ctx`hello ${null}`, 'hello null');
++	assert.equal(ctx`hello ${undefined}`, 'hello undefined');
++	assert.equal(ctx`hello ${null}`, 'hello null');
+ });
+Index: node-chalk/test/windows.js
+===================================================================
+--- node-chalk.orig/test/windows.js
++++ node-chalk/test/windows.js
+@@ -1,6 +1,6 @@
+-import test from 'ava';
+-import importFresh from 'import-fresh';
+-import resolveFrom from 'resolve-from';
++var assert = require('assert');
++var importFresh = require('import-fresh');
++var resolveFrom = require('resolve-from');
+ 
+ // Spoof supports-color
+ require('./_supports-color')(__dirname);
+@@ -26,38 +26,38 @@ test.beforeEach(() => {
+ 	delete require.cache[resolveFrom(__dirname, 'ansi-styles')];
+ });
+ 
+-test('detect a simple term if TERM isn\'t set', t => {
++test('detect a simple term if TERM isn\'t set', function() {
+ 	delete process.env.TERM;
+ 	const m = importFresh('..');
+-	t.is(m.blue('foo'), '\u001B[94mfoo\u001B[39m');
++	assert.equal(m.blue('foo'), '\u001B[94mfoo\u001B[39m');
+ });
+ 
+-test('replace blue foreground color in cmd.exe', t => {
++test('replace blue foreground color in cmd.exe', function() {
+ 	process.env.TERM = 'dumb';
+ 	const m = importFresh('..');
+-	t.is(m.blue('foo'), '\u001B[94mfoo\u001B[39m');
++	assert.equal(m.blue('foo'), '\u001B[94mfoo\u001B[39m');
+ });
+ 
+-test('don\'t replace blue foreground color in xterm based terminals', t => {
++test('don\'t replace blue foreground color in xterm based terminals', function() {
+ 	process.env.TERM = 'xterm-256color';
+ 	const m = importFresh('..');
+-	t.is(m.blue('foo'), '\u001B[34mfoo\u001B[39m');
++	assert.equal(m.blue('foo'), '\u001B[34mfoo\u001B[39m');
+ });
+ 
+-test('don\'t apply dimmed styling on gray strings, see https://github.com/chalk/chalk/issues/58', t => {
++test('don\'t apply dimmed styling on gray strings, see https://github.com/chalk/chalk/issues/58', function() {
+ 	process.env.TERM = 'dumb';
+ 	const m = importFresh('..');
+-	t.is(m.gray.dim('foo'), '\u001B[90mfoo\u001B[22m\u001B[39m');
++	assert.equal(m.gray.dim('foo'), '\u001B[90mfoo\u001B[22m\u001B[39m');
+ });
+ 
+-test('apply dimmed styling on xterm compatible terminals', t => {
++test('apply dimmed styling on xterm compatible terminals', function() {
+ 	process.env.TERM = 'xterm';
+ 	const m = importFresh('..');
+-	t.is(m.gray.dim('foo'), '\u001B[90m\u001B[2mfoo\u001B[22m\u001B[39m');
++	assert.equal(m.gray.dim('foo'), '\u001B[90m\u001B[2mfoo\u001B[22m\u001B[39m');
+ });
+ 
+-test('apply dimmed styling on strings of other colors', t => {
++test('apply dimmed styling on strings of other colors', function() {
+ 	process.env.TERM = 'dumb';
+ 	const m = importFresh('..');
+-	t.is(m.blue.dim('foo'), '\u001B[94m\u001B[2mfoo\u001B[22m\u001B[39m');
++	assert.equal(m.blue.dim('foo'), '\u001B[94m\u001B[2mfoo\u001B[22m\u001B[39m');
+ });
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..c508ffd
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+00-mocha.diff
diff --git a/debian/rules b/debian/rules
index 0c06312..da974fe 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,3 +7,9 @@
 %:
 	dh $@
 
+override_dh_auto_test:
+	mocha -u tdd -R spec test/chalk.js 
+	mocha -u tdd -R spec test/constructor.js 
+	mocha -u tdd -R spec test/enabled.js 
+	mocha -u tdd -R spec test/level.js 
+	mocha -u tdd -R spec test/template-literal.js 
diff --git a/debian/watch b/debian/watch
index 0fba89c..68a7455 100644
--- a/debian/watch
+++ b/debian/watch
@@ -2,5 +2,4 @@ version=3
 opts=\
 dversionmangle=s/\+(debian|dfsg|ds|deb)(\.\d+)?$//,\
 filenamemangle=s/.*\/v?([\d\.-]+)\.tar\.gz/node-chalk-$1.tar.gz/ \
-https://github.com/sindresorhus/chalk/tags \
-.*/archive/v?([\d\.]+).tar.gz
+ https://github.com/chalk/chalk/tags .*/archive/v?([\d\.]+).tar.gz

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-chalk.git



More information about the Pkg-javascript-commits mailing list