[Pkg-javascript-commits] [node-wrap-ansi] 04/04: refresh patches
Paolo Greppi
paolog-guest at moszumanska.debian.org
Wed May 3 08:32:34 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-wrap-ansi.
commit feb1936877fb2646c0155f8abbbae72a7e060979
Author: Paolo Greppi <paolo.greppi at libpf.com>
Date: Wed May 3 09:10:22 2017 +0200
refresh patches
---
debian/patches/00-mocha.diff | 198 +++++++++++++++++++++++--------------------
1 file changed, 107 insertions(+), 91 deletions(-)
diff --git a/debian/patches/00-mocha.diff b/debian/patches/00-mocha.diff
index 50433a5..f1314bd 100644
--- a/debian/patches/00-mocha.diff
+++ b/debian/patches/00-mocha.diff
@@ -1,144 +1,160 @@
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). Skip coverage test (nyc is
- not available as a Debian package).
+ (xo is not available as a Debian package).
Forwarded: not-needed
Author: Paolo Greppi <paolo.greppi at libpf.com>
Index: node-wrap-ansi/package.json
+Index: node-wrap-ansi/package.json
===================================================================
--- node-wrap-ansi.orig/package.json
+++ node-wrap-ansi/package.json
-@@ -19,8 +19,7 @@
+@@ -19,7 +19,7 @@
"node": ">=0.10.0"
},
"scripts": {
-- "test": "xo && nyc node test.js",
-- "coverage": "nyc --reporter=text-lcov node test.js | coveralls"
-+ "test": "mocha -u tdd"
+- "test": "xo && nyc ava",
++ "test": "mocha -u tdd",
+ "coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"files": [
- "index.js"
Index: node-wrap-ansi/test.js
===================================================================
--- node-wrap-ansi.orig/test.js
+++ node-wrap-ansi/test.js
-@@ -1,5 +1,5 @@
- 'use strict';
--var test = require('ava');
+@@ -1,94 +1,94 @@
+-import test from 'ava';
+-import chalk from 'chalk';
+-import hasAnsi from 'has-ansi';
+-import stripAnsi from 'strip-ansi';
+-import fn from './';
+var assert = require('assert');
- var chalk = require('chalk');
- var hasAnsi = require('has-ansi');
- var stripAnsi = require('strip-ansi');
-@@ -10,87 +10,73 @@ var fn = require('./');
- var fixture = 'The quick brown ' + chalk.red('fox jumped over ') + 'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
- var fixture2 = '12345678\n901234567890';
-
--test('wraps string at 20 characters', function (t) {
-+test('wraps string at 20 characters', function () {
- var res20 = fn(fixture, 20);
-
-- t.assert(res20 === 'The quick brown \u001b[31mfox\u001b[39m\n\u001b[31mjumped over \u001b[39mthe lazy\n\u001b[32mdog and then ran\u001b[39m\n\u001b[32maway with the\u001b[39m\n\u001b[32municorn.\u001b[39m');
-- t.assert(stripAnsi(res20).split('\n').every(function (x) {
++var chalk = require('chalk');
++var hasAnsi = require('has-ansi');
++var stripAnsi = require('strip-ansi');
++var fn = require('./');
+
+ // when "hard" is false
+
+-const fixture = 'The quick brown ' + chalk.red('fox jumped over ') + 'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
+-const fixture2 = '12345678\n901234567890';
+-const fixture3 = '12345678\n901234567890 12345';
++var fixture = 'The quick brown ' + chalk.red('fox jumped over ') + 'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
++var fixture2 = '12345678\n901234567890';
++var fixture3 = '12345678\n901234567890 12345';
+
+-test('wraps string at 20 characters', t => {
++test('wraps string at 20 characters', function() {
+ const res20 = fn(fixture, 20);
+
+- t.is(res20, 'The quick brown \u001b[31mfox\u001b[39m\n\u001b[31mjumped over \u001b[39mthe lazy\n\u001b[32mdog and then ran\u001b[39m\n\u001b[32maway with the\u001b[39m\n\u001b[32municorn.\u001b[39m');
+- t.true(stripAnsi(res20).split('\n').every(x => x.length <= 20));
+ assert(res20 === 'The quick brown \u001b[31mfox\u001b[39m\n\u001b[31mjumped over \u001b[39mthe lazy\n\u001b[32mdog and then ran\u001b[39m\n\u001b[32maway with the\u001b[39m\n\u001b[32municorn.\u001b[39m');
-+ assert(stripAnsi(res20).split('\n').every(function (x) {
- return x.length <= 20;
- }));
--
-- t.end();
++ assert(stripAnsi(res20).split('\n').every(x => x.length <= 20));
});
--test('wraps string at 30 characters', function (t) {
-+test('wraps string at 30 characters', function () {
- var res30 = fn(fixture, 30);
+-test('wraps string at 30 characters', t => {
++test('wraps string at 30 characters', function() {
+ const res30 = fn(fixture, 30);
-- t.assert(res30 === 'The quick brown \u001b[31mfox jumped\u001b[39m\n\u001b[31mover \u001b[39mthe lazy \u001b[32mdog and then ran\u001b[39m\n\u001b[32maway with the unicorn.\u001b[39m');
-- t.assert(stripAnsi(res30).split('\n').every(function (x) {
+- t.is(res30, 'The quick brown \u001b[31mfox jumped\u001b[39m\n\u001b[31mover \u001b[39mthe lazy \u001b[32mdog and then ran\u001b[39m\n\u001b[32maway with the unicorn.\u001b[39m');
+- t.true(stripAnsi(res30).split('\n').every(function (x) {
+ assert(res30 === 'The quick brown \u001b[31mfox jumped\u001b[39m\n\u001b[31mover \u001b[39mthe lazy \u001b[32mdog and then ran\u001b[39m\n\u001b[32maway with the unicorn.\u001b[39m');
+ assert(stripAnsi(res30).split('\n').every(function (x) {
return x.length <= 30;
}));
--
-- t.end();
});
--test('does not break strings longer than "cols" characters', function (t) {
-+test('does not break strings longer than "cols" characters', function () {
- var res5 = fn(fixture, 5, {hard: false});
+-test('does not break strings longer than "cols" characters', t => {
++test('does not break strings longer than "cols" characters', function() {
+ const res5 = fn(fixture, 5, {hard: false});
-- t.assert(res5 === 'The\nquick\nbrown\n\u001b[31mfox\u001b[39m\n\u001b[31mjumped\u001b[39m\n\u001b[31mover\u001b[39m\n\u001b[31m\u001b[39mthe\nlazy\n\u001b[32mdog\u001b[39m\n\u001b[32mand\u001b[39m\n\u001b[32mthen\u001b[39m\n\u001b[32mran\u001b[39m\n\u001b[32maway\u001b[39m\n\u001b[32mwith\u001b[39m\n\u001b[32mthe\u001b[39m\n\u001b[32municorn.\u001b[39m');
-- t.assert(
+- t.is(res5, 'The\nquick\nbrown\n\u001b[31mfox\u001b[39m\n\u001b[31mjumped\u001b[39m\n\u001b[31mover\u001b[39m\n\u001b[31m\u001b[39mthe\nlazy\n\u001b[32mdog\u001b[39m\n\u001b[32mand\u001b[39m\n\u001b[32mthen\u001b[39m\n\u001b[32mran\u001b[39m\n\u001b[32maway\u001b[39m\n\u001b[32mwith\u001b[39m\n\u001b[32mthe\u001b[39m\n\u001b[32municorn.\u001b[39m');
+- t.true(stripAnsi(res5).split('\n').filter(x => x.length > 5).length > 0);
+ assert(res5 === 'The\nquick\nbrown\n\u001b[31mfox\u001b[39m\n\u001b[31mjumped\u001b[39m\n\u001b[31mover\u001b[39m\n\u001b[31m\u001b[39mthe\nlazy\n\u001b[32mdog\u001b[39m\n\u001b[32mand\u001b[39m\n\u001b[32mthen\u001b[39m\n\u001b[32mran\u001b[39m\n\u001b[32maway\u001b[39m\n\u001b[32mwith\u001b[39m\n\u001b[32mthe\u001b[39m\n\u001b[32municorn.\u001b[39m');
-+ assert(
- stripAnsi(res5).split('\n').filter(function (x) {
- return x.length > 5;
- }).length > 0
- );
--
-- t.end();
++ assert(stripAnsi(res5).split('\n').filter(x => x.length > 5).length > 0);
});
--test('handles colored string that wraps on to multiple lines', function (t) {
-+test('handles colored string that wraps on to multiple lines', function () {
- var res = fn(chalk.green('hello world') + ' hey!', 5, {hard: false});
- var lines = res.split('\n');
-- t.assert(hasAnsi(lines[0]));
-- t.assert(hasAnsi(lines[1]));
-- t.assert(hasAnsi(lines[2]) === false);
-- t.end();
+-test('handles colored string that wraps on to multiple lines', t => {
++test('handles colored string that wraps on to multiple lines', function() {
+ const res = fn(chalk.green('hello world') + ' hey!', 5, {hard: false});
+ const lines = res.split('\n');
+- t.true(hasAnsi(lines[0]));
+- t.true(hasAnsi(lines[1]));
+- t.false(hasAnsi(lines[2]));
+ assert(hasAnsi(lines[0]));
+ assert(hasAnsi(lines[1]));
-+ assert(hasAnsi(lines[2]) === false);
++ assert(!hasAnsi(lines[2]));
});
--test('does not prepend newline if first string is greater than "cols"', function (t) {
-+test('does not prepend newline if first string is greater than "cols"', function () {
- var res = fn(chalk.green('hello') + '-world', 5, {hard: false});
-- t.assert(res.split('\n').length === 1);
-- t.end();
+-test('does not prepend newline if first string is greater than "cols"', t => {
++test('does not prepend newline if first string is greater than "cols"', function() {
+ const res = fn(chalk.green('hello') + '-world', 5, {hard: false});
+- t.is(res.split('\n').length, 1);
+ assert(res.split('\n').length === 1);
});
// when "hard" is true
--test('breaks strings longer than "cols" characters', function (t) {
-+test('breaks strings longer than "cols" characters', function () {
- var res5 = fn(fixture, 5, {hard: true});
+-test('breaks strings longer than "cols" characters', t => {
++test('breaks strings longer than "cols" characters', function() {
+ const res5 = fn(fixture, 5, {hard: true});
-- t.assert(res5 === 'The\nquick\nbrown\n\u001b[31mfox\u001b[39m\n\u001b[31mjumpe\u001b[39m\n\u001b[31md\u001b[39m\n\u001b[31mover\u001b[39m\n\u001b[31m\u001b[39mthe\nlazy\n\u001b[32mdog\u001b[39m\n\u001b[32mand\u001b[39m\n\u001b[32mthen\u001b[39m\n\u001b[32mran\u001b[39m\n\u001b[32maway\u001b[39m\n\u001b[32mwith\u001b[39m\n\u001b[32mthe\u001b[39m\n\u001b[32munico\u001b[39m\n\u001b[32mrn.\u001b[39m');
-- t.assert(stripAnsi(res5).split('\n').every(function (x) {
+- t.is(res5, 'The\nquick\nbrown\n\u001b[31mfox\u001b[39m\n\u001b[31mjumpe\u001b[39m\n\u001b[31md\u001b[39m\n\u001b[31mover\u001b[39m\n\u001b[31m\u001b[39mthe\nlazy\n\u001b[32mdog\u001b[39m\n\u001b[32mand\u001b[39m\n\u001b[32mthen\u001b[39m\n\u001b[32mran\u001b[39m\n\u001b[32maway\u001b[39m\n\u001b[32mwith\u001b[39m\n\u001b[32mthe\u001b[39m\n\u001b[32munico\u001b[39m\n\u001b[32mrn.\u001b[39m');
+- t.true(stripAnsi(res5).split('\n').every(x => x.length <= 5));
+ assert(res5 === 'The\nquick\nbrown\n\u001b[31mfox\u001b[39m\n\u001b[31mjumpe\u001b[39m\n\u001b[31md\u001b[39m\n\u001b[31mover\u001b[39m\n\u001b[31m\u001b[39mthe\nlazy\n\u001b[32mdog\u001b[39m\n\u001b[32mand\u001b[39m\n\u001b[32mthen\u001b[39m\n\u001b[32mran\u001b[39m\n\u001b[32maway\u001b[39m\n\u001b[32mwith\u001b[39m\n\u001b[32mthe\u001b[39m\n\u001b[32munico\u001b[39m\n\u001b[32mrn.\u001b[39m');
-+ assert(stripAnsi(res5).split('\n').every(function (x) {
- return x.length <= 5;
- }));
--
-- t.end();
++ assert(stripAnsi(res5).split('\n').every(x => x.length <= 5));
});
--test('removes last row if it contained only ansi escape codes', function (t) {
-+test('removes last row if it contained only ansi escape codes', function () {
- var res = fn(chalk.green('helloworld'), 2, {hard: true});
-
-- t.assert(stripAnsi(res).split('\n').every(function (x) {
-+ assert(stripAnsi(res).split('\n').every(function (x) {
- return x.length === 2;
- }));
--
-- t.end();
+-test('removes last row if it contained only ansi escape codes', t => {
++test('removes last row if it contained only ansi escape codes', function() {
+ const res = fn(chalk.green('helloworld'), 2, {hard: true});
+- t.true(stripAnsi(res).split('\n').every(x => x.length === 2));
++ assert(stripAnsi(res).split('\n').every(x => x.length === 2));
});
--test('does not prepend newline if first word is split', function (t) {
-+test('does not prepend newline if first word is split', function () {
- var res = fn(chalk.green('hello') + 'world', 5, {hard: true});
-- t.assert(res.split('\n').length === 2);
-- t.end();
+-test('does not prepend newline if first word is split', t => {
++test('does not prepend newline if first word is split', function() {
+ const res = fn(chalk.green('hello') + 'world', 5, {hard: true});
+- t.is(res.split('\n').length, 2);
+ assert(res.split('\n').length === 2);
});
--test('takes into account line returns inside input', function (t) {
-+test('takes into account line returns inside input', function () {
- var res20 = fn(fixture2, 10, {hard: true});
-- t.assert(res20 === '12345678\n9012345678\n90');
-- t.end();
+-test('takes into account line returns inside input', t => {
++test('takes into account line returns inside input', function() {
+ const res20 = fn(fixture2, 10, {hard: true});
+- t.is(res20, '12345678\n9012345678\n90');
+ assert(res20 === '12345678\n9012345678\n90');
});
+
+-test('word wrapping', t => {
++test('word wrapping', function() {
+ const res = fn(fixture3, 15);
+- t.is(res, '12345678\n901234567890\n12345');
++ assert(res === '12345678\n901234567890\n12345');
+ });
+
+-test('no word-wrapping', t => {
++test('no word-wrapping', function() {
+ const res = fn(fixture3, 15, {wordWrap: false});
+- t.is(res, '12345678\n901234567890 12\n345');
++ assert(res === '12345678\n901234567890 12\n345');
+
+ const res2 = fn(fixture, 5, {wordWrap: false});
+- t.is(res2, 'The q\nuick\nbrown\n[31mfox j[39m\n[31mumped[39m\n[31mover[39m\n[31m[39mthe l\nazy [32md[39m\n[32mog an[39m\n[32md the[39m\n[32mn ran[39m\n[32maway[39m\n[32mwith[39m\n[32mthe u[39m\n[32mnicor[39m\n[32mn.[39m');
++ assert(res2 === 'The q\nuick\nbrown\n[31mfox j[39m\n[31mumped[39m\n[31mover[39m\n[31m[39mthe l\nazy [32md[39m\n[32mog an[39m\n[32md the[39m\n[32mn ran[39m\n[32maway[39m\n[32mwith[39m\n[32mthe u[39m\n[32mnicor[39m\n[32mn.[39m');
+ });
+
+ // https://github.com/chalk/wrap-ansi/issues/10
+-test.failing('supports fullwidth characters', t => {
+- t.is(fn('안녕하세', 4, {hard: true}), '안녕\n하세');
++test.skip('supports fullwidth characters', function() {
++ assert(fn('안녕하세', 4, {hard: true}) === '안녕\n하세');
+ });
+
+ // https://github.com/chalk/wrap-ansi/issues/11
+-test.failing('supports unicode surrogate pairs', t => {
+- t.is(fn('a\ud83c\ude00bc', 2, {hard: true}), 'a\n\ud83c\ude00\nbc');
++test.skip('supports unicode surrogate pairs', function() {
++ assert(fn('a\ud83c\ude00bc', 2, {hard: true}) === 'a\n\ud83c\ude00\nbc');
+ });
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-wrap-ansi.git
More information about the Pkg-javascript-commits
mailing list