File: 00-mocha.diff

package info (click to toggle)
node-string-width 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 144 kB
  • ctags: 4
  • sloc: makefile: 4; sh: 2
file content (73 lines) | stat: -rw-r--r-- 2,185 bytes parent folder | download
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
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).
Forwarded: not-needed
Author: Paolo Greppi <paolo.greppi@libpf.com>

Index: node-string-width/test.js
===================================================================
--- node-string-width.orig/test.js
+++ node-string-width/test.js
@@ -1,22 +1,21 @@
-import test from 'ava';
-import m from './';
+var m = require('./');
+var assert = require('assert');

-test('main', t => {
-	t.is(m('abcde'), 5);
-	t.is(m('古池や'), 6);
-	t.is(m('あいうabc'), 9);
-	t.is(m('ノード.js'), 9);
-	t.is(m('你好'), 4);
-	t.is(m('안녕하세요'), 10);
-	t.is(m('A\ud83c\ude00BC'), 5, 'surrogate');
-	t.is(m('\u001b[31m\u001b[39m'), 0);
+test('main', function() {
+	assert.equal(m('abcde'), 5);
+	assert.equal(m('古池や'), 6);
+	assert.equal(m('あいうabc'), 9);
+	assert.equal(m('ノード.js'), 9);
+	assert.equal(m('你好'), 4);
+	assert.equal(m('안녕하세요'), 10);
+	assert.equal(m('\u001b[31m\u001b[39m'), 0);
 });

-test('ignores control characters', t => {
-	t.is(m(String.fromCharCode(0)), 0);
-	t.is(m(String.fromCharCode(31)), 0);
-	t.is(m(String.fromCharCode(127)), 0);
-	t.is(m(String.fromCharCode(134)), 0);
-	t.is(m(String.fromCharCode(159)), 0);
-	t.is(m('\u001b'), 0);
+test('ignores control characters', function() {
+	assert.equal(m(String.fromCharCode(0)), 0);
+	assert.equal(m(String.fromCharCode(31)), 0);
+	assert.equal(m(String.fromCharCode(127)), 0);
+	assert.equal(m(String.fromCharCode(134)), 0);
+	assert.equal(m(String.fromCharCode(159)), 0);
+	assert.equal(m('\u001b'), 0);
 });
Index: node-string-width/package.json
===================================================================
--- node-string-width.orig/package.json
+++ node-string-width/package.json
@@ -13,7 +13,7 @@
     "node": ">=4"
   },
   "scripts": {
-    "test": "xo && ava"
+    "test": "mocha -u tdd"
   },
   "files": [
     "index.js"
@@ -49,8 +49,7 @@
     "strip-ansi": "^3.0.0"
   },
   "devDependencies": {
-    "ava": "*",
-    "xo": "*"
+    "mocha": "*"
   },
   "xo": {
     "esnext": true