[Pkg-javascript-commits] [node-chalk] 01/01: enable tests during packaging

Paolo Greppi paolog-guest at moszumanska.debian.org
Wed Nov 23 16:03:22 UTC 2016


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

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

commit 9b85df831f7908cf70e245854e418ca10a6d969f
Author: Paolo Greppi <paolo.greppi at libpf.com>
Date:   Wed Nov 23 15:56:54 2016 +0000

    enable tests during packaging
    
    just get rid of build dependencies required for testing only on Windows
    ...
---
 debian/changelog                            |  8 +++
 debian/patches/00-remove_windows_tests.diff | 82 +++++++++++++++++++++++++++++
 debian/patches/series                       |  1 +
 debian/rules                                |  2 +-
 debian/tests/control                        |  3 ++
 5 files changed, 95 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 9ddef2d..94b8ca2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+node-chalk (1.1.3-2) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Get rid of build dependencies required for testing only on Windows
+    and enable tests during packaging.
+
+ -- Paolo Greppi <paolo.greppi at libpf.com>  Wed, 23 Nov 2016 15:49:31 +0000
+
 node-chalk (1.1.3-1) unstable; urgency=low
 
   [ Bas Couwenberg ]
diff --git a/debian/patches/00-remove_windows_tests.diff b/debian/patches/00-remove_windows_tests.diff
new file mode 100644
index 0000000..93180c1
--- /dev/null
+++ b/debian/patches/00-remove_windows_tests.diff
@@ -0,0 +1,82 @@
+Description: Remove build dependency on modules only required for
+ testing on Windows.
+Forwarded: not-needed
+Author: Paolo Greppi <paolo.greppi at libpf.com>
+
+Index: node-chalk/test.js
+===================================================================
+--- node-chalk.orig/test.js
++++ node-chalk/test.js
+@@ -1,7 +1,5 @@
+ 'use strict';
+ var assert = require('assert');
+-var requireUncached = require('require-uncached');
+-var resolveFrom = require('resolve-from');
+ var semver = require('semver');
+ var chalk = require('./');
+ 
+@@ -63,64 +61,6 @@ describe('chalk', function () {
+ 	});
+ });
+ 
+-describe('chalk on windows', function () {
+-	var originalEnv;
+-	var originalPlatform;
+-
+-	// in node versions older than 0.12.x process.platform cannot be overridden
+-	if (semver.lt(process.version, '0.12.0')) {
+-		return;
+-	}
+-
+-	before(function () {
+-		originalEnv = process.env;
+-		originalPlatform = process.platform;
+-	});
+-
+-	after(function () {
+-		process.env = originalEnv;
+-		Object.defineProperty(process, 'platform', {value: originalPlatform});
+-	});
+-
+-	beforeEach(function () {
+-		process.env = {};
+-		Object.defineProperty(process, 'platform', {value: 'win32'});
+-		// since chalk internally modifies ansiStyles.blue.open, ansi-styles needs
+-		// to be removed from the require cache for require-uncached to work
+-		delete require.cache[resolveFrom(__dirname, 'ansi-styles')];
+-	});
+-
+-	it('should replace blue foreground color in cmd.exe', function () {
+-		process.env.TERM = 'dumb';
+-		var chalkCtx = requireUncached('./');
+-		assert.equal(chalkCtx.blue('foo'), '\u001b[94mfoo\u001b[39m');
+-	});
+-
+-	it('shouldn\'t replace blue foreground color in xterm based terminals', function () {
+-		process.env.TERM = 'xterm-256color';
+-		var chalkCtx = requireUncached('./');
+-		assert.equal(chalkCtx.blue('foo'), '\u001b[34mfoo\u001b[39m');
+-	});
+-
+-	it('should not apply dimmed styling on gray strings, see https://github.com/chalk/chalk/issues/58', function () {
+-		process.env.TERM = 'dumb';
+-		var chalkCtx = requireUncached('./');
+-		assert.equal(chalkCtx.gray.dim('foo'), '\u001b[90mfoo\u001b[22m\u001b[39m');
+-	});
+-
+-	it('should apply dimmed styling on xterm compatible terminals', function () {
+-		process.env.TERM = 'xterm';
+-		var chalkCtx = requireUncached('./');
+-		assert.equal(chalkCtx.gray.dim('foo'), '\u001b[90m\u001b[2mfoo\u001b[22m\u001b[39m');
+-	});
+-
+-	it('should apply dimmed styling on strings of other colors', function () {
+-		process.env.TERM = 'dumb';
+-		var chalkCtx = requireUncached('./');
+-		assert.equal(chalkCtx.blue.dim('foo'), '\u001b[94m\u001b[2mfoo\u001b[22m\u001b[39m');
+-	});
+-});
+-
+ describe('chalk.enabled', function () {
+ 	it('should not output colors when manually disabled', function () {
+ 		chalk.enabled = false;
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..09924a3
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+00-remove_windows_tests.diff
diff --git a/debian/rules b/debian/rules
index 786fd71..e5cfe00 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,5 +8,5 @@
 	dh $@
 
 override_dh_auto_test:
-	#mocha (require-uncached, resolve-from not available)
+	mocha
 
diff --git a/debian/tests/control b/debian/tests/control
index b962bf6..22938a8 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
 Tests: require
 Depends: node-chalk
+
+Test-Command: mocha
+Depends: @, @builddeps@

-- 
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