[Pkg-javascript-devel] enabling tests in node-chalk package
Paolo Greppi
paolo.greppi at libpf.com
Wed Nov 23 16:03:51 UTC 2016
Hi,
While working on node-wrap-ansi (which will depend on node-chalk) I
noticed that two of the missing build deps for node-chalk
(require-uncached and resolve-from) are required precisely for testing,
that's why the mocha line in debian/rules is commented ATM.
BUT they are only required for testing on Windows ! so the dependency
can be easy to get rid of by simply patching test.js.
I have tried that, and the tests run and pass from the command line
(just type "mocha"). That's fine, except that if I enable the tests
during the build process, uncommenting the line above in debian/rules,
they fail like this:
․․․․․․․․․․․․․․․․․․․․
6 passing (32ms)
14 failing
1) chalk should style string:
AssertionError: 'foo' == '\u001b[4mfoo\u001b[24m'
+ expected - actual
-foo
+foo
at Context.<anonymous>
(/root/debian/node-chalk/node--chalk/test.js:10:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at Immediate._onImmediate
(/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
2) chalk should support applying multiple styles at once:
AssertionError: 'foo' ==
'\u001b[31m\u001b[42m\u001b[4mfoo\u001b[24m\u001b[49m\u001b[39m'
+ expected - actual
-foo
+foo
at Context.<anonymous>
(/root/debian/node-chalk/node-chalk/test.js:16:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at Immediate._onImmediate
(/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
3) chalk should support nesting styles:
AssertionError: 'foobar!' ==
'\u001b[31mfoo\u001b[4m\u001b[44mbar\u001b[49m\u001b[24m!\u001b[39m'
+ expected - actual
-foobar!
+foobar!
at Context.<anonymous>
(/root/debian/node-chalk/node-chalk/test.js:21:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at Immediate._onImmediate
(/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
4) chalk should support nesting styles of the same type (color,
underline, bg):
AssertionError: 'abcbc' ==
'\u001b[31ma\u001b[33mb\u001b[32mc\u001b[33mb\u001b[31mc\u001b[39m'
+ expected - actual
-abcbc
+abcbc
at Context.<anonymous>
(/root/debian/node-chalk/node-chalk/test.js:28:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at Immediate._onImmediate
(/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
5) chalk should reset all styles with `.reset()`:
AssertionError: 'foofoo' ==
'\u001b[0m\u001b[31m\u001b[42m\u001b[4mfoo\u001b[24m\u001b[49m\u001b[39mfoo\u001b[0m'
+ expected - actual
-foofoo
+foofoo
at Context.<anonymous>
(/root/debian/node-chalk/node-chalk/test.js:35:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at Immediate._onImmediate
(/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
6) chalk should be able to cache multiple styles:
AssertionError: 'foo' != 'foo'
+ expected - actual
at Context.<anonymous>
(/root/debian/node-chalk/node-chalk/test.js:44:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at Immediate._onImmediate
(/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
7) chalk should alias gray to grey:
AssertionError: 'foo' == '\u001b[90mfoo\u001b[39m'
+ expected - actual
-foo
+foo
at Context.<anonymous>
(/root/debian/node-chalk/node-chalk/test.js:50:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at Immediate._onImmediate
(/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
8) chalk should support variable number of arguments:
AssertionError: 'foo bar' == '\u001b[31mfoo bar\u001b[39m'
+ expected - actual
-foo bar
+foo bar
at Context.<anonymous>
(/root/debian/node-chalk/node-chalk/test.js:54:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at Immediate._onImmediate
(/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
9) chalk should support falsy values:
AssertionError: '0' == '\u001b[31m0\u001b[39m'
+ expected - actual
-0
+0
at Context.<anonymous>
(/root/debian/node-chalk/node-chalk/test.js:58:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at Immediate._onImmediate
(/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
10) chalk on windows should replace blue foreground color in cmd.exe:
AssertionError: 'foo' == '\u001b[94mfoo\u001b[39m'
+ expected - actual
-foo
+foo
at Context.<anonymous>
(/root/debian/node-chalk/node-chalk/test.js:96:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at /usr/lib/nodejs/mocha/lib/runner.js:270:7
at done (/usr/lib/nodejs/mocha/lib/runnable.js:185:5)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:228:7)
at Hook.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at next (/usr/lib/nodejs/mocha/lib/runner.js:258:10)
at Immediate._onImmediate
(/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
11) chalk on windows shouldn't replace blue foreground color in xterm
based terminals:
AssertionError: 'foo' == '\u001b[34mfoo\u001b[39m'
+ expected - actual
-foo
+foo
at Context.<anonymous>
(/root/debian/node-chalk/node-chalk/test.js:102:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at /usr/lib/nodejs/mocha/lib/runner.js:270:7
at done (/usr/lib/nodejs/mocha/lib/runnable.js:185:5)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:228:7)
at Hook.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at next (/usr/lib/nodejs/mocha/lib/runner.js:258:10)
at Immediate._onImmediate
(/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
12) chalk on windows should not apply dimmed styling on gray strings,
see https://github.com/chalk/chalk/issues/58:
AssertionError: 'foo' == '\u001b[90mfoo\u001b[22m\u001b[39m'
+ expected - actual
-foo
+foo
at Context.<anonymous>
(/root/debian/node-chalk/node-chalk/test.js:108:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at /usr/lib/nodejs/mocha/lib/runner.js:270:7
at done (/usr/lib/nodejs/mocha/lib/runnable.js:185:5)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:228:7)
at Hook.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at next (/usr/lib/nodejs/mocha/lib/runner.js:258:10)
at Immediate._onImmediate
(/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
13) chalk on windows should apply dimmed styling on xterm compatible
terminals:
AssertionError: 'foo' == '\u001b[90m\u001b[2mfoo\u001b[22m\u001b[39m'
+ expected - actual
-foo
+foo
at Context.<anonymous>
(/root/debian/node-chalk/node-chalk/test.js:114:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at /usr/lib/nodejs/mocha/lib/runner.js:270:7
at done (/usr/lib/nodejs/mocha/lib/runnable.js:185:5)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:228:7)
at Hook.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at next (/usr/lib/nodejs/mocha/lib/runner.js:258:10)
at Immediate._onImmediate (/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
14) chalk on windows should apply dimmed styling on strings of other
colors:
AssertionError: 'foo' == '\u001b[94m\u001b[2mfoo\u001b[22m\u001b[39m'
+ expected - actual
-foo
+foo
at Context.<anonymous>
(/root/debian/node-chalk/node-chalk/test.js:120:10)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:223:21)
at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
at /usr/lib/nodejs/mocha/lib/runner.js:451:12
at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
at /usr/lib/nodejs/mocha/lib/runner.js:308:7
at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
at /usr/lib/nodejs/mocha/lib/runner.js:270:7
at done (/usr/lib/nodejs/mocha/lib/runnable.js:185:5)
at callFn (/usr/lib/nodejs/mocha/lib/runnable.js:228:7)
at Hook.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:216:7)
at next (/usr/lib/nodejs/mocha/lib/runner.js:258:10)
at Immediate._onImmediate (/usr/lib/nodejs/mocha/lib/runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:383:17)
debian/rules:11: set di istruzioni per l'obiettivo
"override_dh_auto_test" non riuscito
make[1]: *** [override_dh_auto_test] Errore 14
make[1]: uscita dalla directory "/root/debian/node-chalk/node-chalk"
debian/rules:8: set di istruzioni per l'obiettivo "build" non riuscito
make: *** [build] Errore 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
debuild: fatal error at line 1376:
dpkg-buildpackage -rfakeroot -D -us -uc -i -I failed
gbp:error: 'debuild -i -I -uc -us' failed: it exited with 29
It looks like chalk is idempotent (has no effect) when run from within
debhelper. Any idea why ?
You can try at home if you wish because I have pushed these changes in
the repo on alioth as an unreleased team upload.
I CC the maintainer as well ...
Thanks, P
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-javascript-devel/attachments/20161123/aef33a5b/attachment.sig>
More information about the Pkg-javascript-devel
mailing list