[Pkg-javascript-commits] [node-cli-cursor] 01/03: refresh patch

Paolo Greppi paolog-guest at moszumanska.debian.org
Mon Oct 30 12:12:52 UTC 2017


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

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

commit ab3cc7ccf2ef2913739a04e192c548462e65976e
Author: Paolo Greppi <paolo.greppi at libpf.com>
Date:   Mon Oct 30 12:22:44 2017 +0100

    refresh patch
---
 debian/patches/00-mocha.diff | 55 +++++++++++++++++++-------------------------
 1 file changed, 24 insertions(+), 31 deletions(-)

diff --git a/debian/patches/00-mocha.diff b/debian/patches/00-mocha.diff
index 77f90e5..d2efbe8 100644
--- a/debian/patches/00-mocha.diff
+++ b/debian/patches/00-mocha.diff
@@ -1,9 +1,9 @@
 Description: Change from ava to mocha as test runner (ava is not yet
- available as a Debian package). Skip the xo style linter test step
- (xo is not available as a Debian package).
+ 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/let /var /g' test.js
 Forwarded: not-needed
 Author: Paolo Greppi <paolo.greppi at libpf.com>
 
@@ -11,7 +11,7 @@ Index: node-cli-cursor/test.js
 ===================================================================
 --- node-cli-cursor.orig/test.js
 +++ node-cli-cursor/test.js
-@@ -1,13 +1,13 @@
+@@ -1,6 +1,6 @@
 -import childProcess from 'child_process';
 -import test from 'ava';
 -import cliCursor from './';
@@ -19,78 +19,71 @@ Index: node-cli-cursor/test.js
 +var assert = require('assert');
 +var cliCursor = require('./');
  
- const write = process.stdout.write;
+ const write = process.stderr.write;
  const SHOW = '\u001b[?25h';
- const HIDE = '\u001b[?25l';
+@@ -9,7 +9,7 @@ const HIDE = '\u001b[?25l';
+ process.stderr.isTTY = true;
  
- function getStdout(fn) {
+ function getStderr(fn) {
 -	let ret = '';
 +	var ret = '';
  
- 	process.stdout.setEncoding('utf8');
- 	process.stdout.write = str => {
-@@ -19,48 +19,40 @@ function getStdout(fn) {
+ 	process.stderr.setEncoding('utf8');
+ 	process.stderr.write = str => {
+@@ -21,40 +21,40 @@ function getStderr(fn) {
  	return ret;
  }
  
 -test('show', t => {
--	t.is(getStdout(cliCursor.show), SHOW);
--	t.end();
+-	t.is(getStderr(cliCursor.show), SHOW);
 +test('show', function() {
-+	assert.equal(getStdout(cliCursor.show), SHOW);
++	assert.equal(getStderr(cliCursor.show), SHOW);
  });
  
 -test('hide', t => {
--	t.is(getStdout(cliCursor.hide), HIDE);
--	t.end();
+-	t.is(getStderr(cliCursor.hide), HIDE);
 +test('hide', function() {
-+	assert.equal(getStdout(cliCursor.hide), HIDE);
++	assert.equal(getStderr(cliCursor.hide), HIDE);
  });
  
 -test('toggle', t => {
 +test('toggle', function() {
  	cliCursor.hide();
--	t.is(getStdout(cliCursor.toggle), SHOW);
--	t.end();
-+	assert.equal(getStdout(cliCursor.toggle), SHOW);
+-	t.is(getStderr(cliCursor.toggle), SHOW);
++	assert.equal(getStderr(cliCursor.toggle), SHOW);
  });
  
 -test('toggle 2', t => {
 +test('toggle 2', function() {
  	cliCursor.show();
--	t.is(getStdout(cliCursor.toggle), HIDE);
--	t.end();
-+	assert.equal(getStdout(cliCursor.toggle), HIDE);
+-	t.is(getStderr(cliCursor.toggle), HIDE);
++	assert.equal(getStderr(cliCursor.toggle), HIDE);
  });
  
 -test('toggle force', t => {
 +test('toggle force', function() {
  	cliCursor.show();
--	t.is(getStdout(cliCursor.toggle.bind(null, true)), SHOW);
--	t.end();
-+	assert.equal(getStdout(cliCursor.toggle.bind(null, true)), SHOW);
+-	t.is(getStderr(cliCursor.toggle.bind(null, true)), SHOW);
++	assert.equal(getStderr(cliCursor.toggle.bind(null, true)), SHOW);
  });
  
 -test('toggle force 2', t => {
 +test('toggle force 2', function() {
  	cliCursor.hide();
--	t.is(getStdout(cliCursor.toggle.bind(null, true)), SHOW);
--	t.end();
-+	assert.equal(getStdout(cliCursor.toggle.bind(null, true)), SHOW);
+-	t.is(getStderr(cliCursor.toggle.bind(null, true)), SHOW);
++	assert.equal(getStderr(cliCursor.toggle.bind(null, true)), SHOW);
  });
  
 -test('toggle force 3', t => {
 +test('toggle force 3', function() {
  	cliCursor.show();
--	t.is(getStdout(cliCursor.toggle.bind(null, false)), HIDE);
--	t.end();
-+	assert.equal(getStdout(cliCursor.toggle.bind(null, false)), HIDE);
+-	t.is(getStderr(cliCursor.toggle.bind(null, false)), HIDE);
++	assert.equal(getStderr(cliCursor.toggle.bind(null, false)), HIDE);
  });
  
  // used to fail, see sindresorhus/log-update#2
 -test('require', t => {
 -	t.is(childProcess.execSync('node index.js', {encoding: 'utf8'}), '');
--	t.end();
 +test('require', function() {
 +	assert.equal(childProcess.execSync('node index.js', {encoding: 'utf8'}), '');
  });

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



More information about the Pkg-javascript-commits mailing list