File: replace-ava-by-tape.diff

package info (click to toggle)
node-colormin 1.1.2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 220 kB
  • sloc: makefile: 4
file content (88 lines) | stat: -rw-r--r-- 7,215 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Description: replace ava by tape in test
Author: Xavier Guimard <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2020-04-29

--- a/src/__tests__/index.js
+++ b/src/__tests__/index.js
@@ -1,44 +1,46 @@
-import test from 'ava';
-import min from '..';
+const test = require('tape');
+const min = require('../..');
 
 function isEqual (t, input, output, options = {}) {
     t.deepEqual(min(input, options), output);
+    t.end();
 }
 
-test('should lowercase keywords', isEqual, 'RED', 'red');
-test('should convert shorthand hex to keyword', isEqual, '#f00', 'red');
-test('should convert longhand hex to keyword', isEqual, '#ff0000', 'red');
-test('should convert rgb to keyword', isEqual, 'rgb(255,0,0)', 'red');
-test('should convert fully opaque rgb to keyword', isEqual, 'rgba(255, 0, 0, 1)', 'red');
-test('should convert hsl to keyword', isEqual, 'hsl(0, 100%, 50%)', 'red');
-test('should convert fully oqaque hsl to keyword', isEqual, 'hsla(0, 100%, 50%, 1)', 'red');
-test('should convert translucent hsla to rgba', isEqual, 'hsla(0, 100%, 50%, .5)', 'rgba(255,0,0,.5)');
-test('should convert longhand hex to shorthand, case insensitive', isEqual, '#FFFFFF', '#fff');
-test('should convert keyword to hex, case insensitive', isEqual, 'WHiTE', '#fff');
-test('should convert keyword to hex', isEqual, 'yellow', '#ff0');
-test('should convert rgb to hex', isEqual, 'rgb(12, 134, 29)', '#0c861d');
-test('should convert hsl to hex', isEqual, 'hsl(230, 50%, 40%)', '#349');
-test('should convert another longhand hex to keyword', isEqual, '#000080', 'navy');
-test('should convert rgba to hsla when shorter', isEqual, 'rgba(199, 190, 179, 0.8)', 'hsla(33,15%,74%,.8)');
-test('should convert this specific rgba value to "transparent"', isEqual, 'rgba(0,0,0,0)', 'transparent');
-test('should not convert this specific rgba value to "transparent" (legacy mode)', isEqual, 'rgba(0,0,0,0)', 'rgba(0,0,0,0)', {legacy: true});
-test('should convert this specific hsla value to "transparent"', isEqual, 'hsla(0,0%,0%,0)', 'transparent');
-test('should convert hsla values with 0 saturation & 0 lightness to "transparent"', isEqual, 'hsla(200,0%,0%,0)', 'transparent');
-test('should leave transparent as it is', isEqual, 'transparent', 'transparent');
-test('should prefer to output hex rather than keywords when they are the same length', isEqual, '#696969', '#696969');
-test('should cap values at their maximum', isEqual, 'rgb(400,400,400)', '#fff');
-test('should cap values at their maximum (2)', isEqual, 'hsl(400, 400%, 50%)', 'red');
-test('should remove leading zeros', isEqual, 'hsla(0, 0%, 100%, 0.5)', 'hsla(0,0%,100%,.5)');
-test('should convert signed numbers', isEqual, 'rgba(-100,0,-100,.5)', 'rgba(0,0,0,.5)');
-test('should convert signed numbers (2)', isEqual, 'hsla(-400,50%,10%,.5)', 'rgba(38,13,13,.5)');
-test('should convert percentage based rgb values', isEqual, 'rgb(100%,100%,100%)', '#fff');
-test('should convert percentage based rgba values (2)', isEqual, 'rgba(50%,50%,50%,0.5)', 'hsla(0,0%,50%,.5)');
-test('should convert percentage based rgba values (3)', isEqual, 'rgb(100%,100%,100%)', '#fff');
-test('should convert percentage based rgba values (4)', isEqual, 'rgba(100%,100%,100%,0.5)', 'hsla(0,0%,100%,.5)');
-test('should convert percentage based rgba values (5)', isEqual, 'rgba(100%,64.7%,0%,.5)', 'rgba(255,165,0,.5)');
-test('should pass through on invalid rgb functions', isEqual, 'rgb(50%,23,54)', 'rgb(50%,23,54)');
+test('should lowercase keywords', function(t) {isEqual(t, 'RED', 'red')});
+test('should convert shorthand hex to keyword', function(t) {isEqual(t, '#f00', 'red')});
+test('should convert longhand hex to keyword', function(t) {isEqual(t, '#ff0000', 'red')});
+test('should convert rgb to keyword', function(t) {isEqual(t, 'rgb(255,0,0)', 'red')});
+test('should convert fully opaque rgb to keyword', function(t) {isEqual(t, 'rgba(255, 0, 0, 1)', 'red')});
+test('should convert hsl to keyword', function(t) {isEqual(t, 'hsl(0, 100%, 50%)', 'red')});
+test('should convert fully oqaque hsl to keyword', function(t) {isEqual(t, 'hsla(0, 100%, 50%, 1)', 'red')});
+test('should convert translucent hsla to rgba', function(t) {isEqual(t, 'hsla(0, 100%, 50%, .5)', 'rgba(255,0,0,.5)')});
+test('should convert longhand hex to shorthand, case insensitive', function(t) {isEqual(t, '#FFFFFF', '#fff')});
+test('should convert keyword to hex, case insensitive', function(t) {isEqual(t, 'WHiTE', '#fff')});
+test('should convert keyword to hex', function(t) {isEqual(t, 'yellow', '#ff0')});
+test('should convert rgb to hex', function(t) {isEqual(t, 'rgb(12, 134, 29)', '#0c861d')});
+test('should convert hsl to hex', function(t) {isEqual(t, 'hsl(230, 50%, 40%)', '#349')});
+test('should convert another longhand hex to keyword', function(t) {isEqual(t, '#000080', 'navy')});
+test('should convert rgba to hsla when shorter', function(t) {isEqual(t, 'rgba(199, 190, 179, 0.8)', 'hsla(33,15%,74%,.8)')});
+test('should convert this specific rgba value to "transparent"', function(t) {isEqual(t, 'rgba(0,0,0,0)', 'transparent')});
+test('should not convert this specific rgba value to "transparent" (legacy mode)', function(t) {isEqual(t, 'rgba(0,0,0,0)', 'rgba(0,0,0,0)', {legacy: true})});
+test('should convert this specific hsla value to "transparent"', function(t) {isEqual(t, 'hsla(0,0%,0%,0)', 'transparent')});
+test('should convert hsla values with 0 saturation & 0 lightness to "transparent"', function(t) {isEqual(t, 'hsla(200,0%,0%,0)', 'transparent')});
+test('should leave transparent as it is', function(t) {isEqual(t, 'transparent', 'transparent')});
+test('should prefer to output hex rather than keywords when they are the same length', function(t) {isEqual(t, '#696969', '#696969')});
+test('should cap values at their maximum', function(t) {isEqual(t, 'rgb(400,400,400)', '#fff')});
+test('should cap values at their maximum (2)', function(t) {isEqual(t, 'hsl(400, 400%, 50%)', 'red')});
+test('should remove leading zeros', function(t) {isEqual(t, 'hsla(0, 0%, 100%, 0.5)', 'hsla(0,0%,100%,.5)')});
+test('should convert signed numbers', function(t) {isEqual(t, 'rgba(-100,0,-100,.5)', 'rgba(0,0,0,.5)')});
+test('should convert signed numbers (2)', function(t) {isEqual(t, 'hsla(-400,50%,10%,.5)', 'rgba(38,13,13,.5)')});
+test('should convert percentage based rgb values', function(t) {isEqual(t, 'rgb(100%,100%,100%)', '#fff')});
+test('should convert percentage based rgba values (2)', function(t) {isEqual(t, 'rgba(50%,50%,50%,0.5)', 'hsla(0,0%,50%,.5)')});
+test('should convert percentage based rgba values (3)', function(t) {isEqual(t, 'rgb(100%,100%,100%)', '#fff')});
+test('should convert percentage based rgba values (4)', function(t) {isEqual(t, 'rgba(100%,100%,100%,0.5)', 'hsla(0,0%,100%,.5)')});
+test('should convert percentage based rgba values (5)', function(t) {isEqual(t, 'rgba(100%,64.7%,0%,.5)', 'rgba(255,165,0,.5)')});
+test('should pass through on invalid rgb functions', function(t) {isEqual(t, 'rgb(50%,23,54)', 'rgb(50%,23,54)')});
 
 test('should pass through if not recognised', t => {
     t.deepEqual(min('Unrecognised'), 'Unrecognised');
     t.deepEqual(min('inherit'), 'inherit');
+    t.end();
 });