Skip to content

Commit da6a92e

Browse files
committed
Update dev-dependencies
1 parent 1ed409a commit da6a92e

File tree

3 files changed

+74
-63
lines changed

3 files changed

+74
-63
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DS_Store
22
*.log
3-
build/
4-
components/
3+
.nyc_output/
54
coverage/
65
node_modules/
7-
build.js
6+
unist-util-modify-children.js
7+
unist-util-modify-children.min.js

package.json

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,43 +13,50 @@
1313
"modify",
1414
"children"
1515
],
16-
"dependencies": {
17-
"array-iterate": "^1.0.0"
18-
},
19-
"repository": "wooorm/unist-util-modify-children",
20-
"author": "Titus Wormer <tituswormer@gmail.com>",
16+
"repository": "https://github.com/wooorm/unist-util-modify-children",
17+
"bugs": "https://github.com/wooorm/unist-util-modify-children/issues",
18+
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)",
19+
"contributors": [
20+
"Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)"
21+
],
2122
"files": [
2223
"index.js"
2324
],
25+
"dependencies": {
26+
"array-iterate": "^1.0.0"
27+
},
2428
"devDependencies": {
25-
"browserify": "^11.0.0",
29+
"browserify": "^13.1.1",
2630
"esmangle": "^1.0.0",
27-
"istanbul": "^0.3.0",
28-
"mdast": "^1.0.0",
29-
"mdast-comment-config": "^1.0.0",
30-
"mdast-github": "^1.0.0",
31-
"mdast-lint": "^1.0.0",
32-
"mdast-slug": "^1.0.0",
33-
"mdast-validate-links": "^1.0.0",
34-
"mocha": "^2.0.0",
31+
"nyc": "^9.0.1",
32+
"remark-cli": "^2.0.0",
33+
"remark-preset-wooorm": "^1.0.0",
34+
"tape": "^4.6.2",
3535
"xo": "^0.17.1"
3636
},
3737
"scripts": {
38-
"test-api": "mocha --check-leaks test.js",
39-
"test-coverage": "istanbul cover _mocha -- test.js",
40-
"test-travis": "npm run test-coverage",
41-
"test": "npm run test-api",
38+
"build-md": "remark . --quiet --frail --output",
39+
"build-bundle": "browserify index.js --bare -s unistUtilModifyChildren > unist-util-modify-children.js",
40+
"build-mangle": "esmangle < unist-util-modify-children.js > unist-util-modify-children.min.js",
41+
"build": "npm run build-md && npm run build-bundle && npm run build-mangle",
4242
"lint": "xo",
43-
"make": "npm run lint && npm run test-coverage",
44-
"bundle": "browserify index.js --no-builtins -s unistUtilModifyChildren > unist-util-modify-children.js",
45-
"postbundle": "esmangle unist-util-modify-children.js > unist-util-modify-children.min.js",
46-
"build-md": "mdast . --quiet",
47-
"build": "npm run bundle && npm run build-md"
43+
"test-api": "node test",
44+
"test-coverage": "nyc --reporter lcov tape test.js",
45+
"test": "npm run build && npm run lint && npm run test-coverage"
4846
},
4947
"xo": {
5048
"space": true,
5149
"ignore": [
5250
"unist-util-modify-children.js"
5351
]
52+
},
53+
"nyc": {
54+
"check-coverage": true,
55+
"lines": 100,
56+
"functions": 100,
57+
"branches": 100
58+
},
59+
"remarkConfig": {
60+
"presets": "wooorm"
5461
}
5562
}

test.js

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,28 @@
11
'use strict';
22

3-
/* eslint-env mocha */
4-
5-
var assert = require('assert');
3+
var test = require('tape');
64
var modifyChildren = require('./');
75

8-
var throws = assert.throws;
9-
var equal = assert.strictEqual;
10-
var deepEqual = assert.deepEqual;
11-
126
var noop = Function.prototype;
137

14-
describe('modifyChildren()', function () {
15-
it('should throw when no `parent` is given', function () {
16-
throws(
17-
function () {
18-
modifyChildren(noop)();
19-
},
20-
/Missing children in `parent`/
21-
);
22-
23-
throws(
24-
function () {
25-
modifyChildren(noop)({});
26-
},
27-
/Missing children in `parent`/
28-
);
29-
});
30-
31-
it('should invoke `fn` for each child in `parent`', function () {
8+
test('modifyChildren()', function (t) {
9+
t.throws(
10+
function () {
11+
modifyChildren(noop)();
12+
},
13+
/Missing children in `parent`/,
14+
'should throw without node'
15+
);
16+
17+
t.throws(
18+
function () {
19+
modifyChildren(noop)({});
20+
},
21+
/Missing children in `parent`/,
22+
'should throw without parent'
23+
);
24+
25+
t.test('should invoke `fn` for each child in `parent`', function (st) {
3226
var values = [0, 1, 2, 3];
3327
var context = {};
3428
var n = -1;
@@ -37,13 +31,15 @@ describe('modifyChildren()', function () {
3731

3832
modifyChildren(function (child, index, parent) {
3933
n++;
40-
equal(child, values[n]);
41-
equal(index, n);
42-
equal(parent, context);
34+
st.strictEqual(child, values[n]);
35+
st.strictEqual(index, n);
36+
st.strictEqual(parent, context);
4337
})(context);
38+
39+
st.end();
4440
});
4541

46-
it('should work when new children are added', function () {
42+
t.test('should work when new children are added', function (st) {
4743
var values = [0, 1, 2, 3, 4, 5, 6];
4844
var n = -1;
4945

@@ -54,31 +50,35 @@ describe('modifyChildren()', function () {
5450
parent.children.push(parent.children.length);
5551
}
5652

57-
equal(child, values[n]);
58-
equal(index, values[n]);
53+
st.strictEqual(child, values[n]);
54+
st.strictEqual(index, values[n]);
5955
})({children: [0, 1, 2, 3]});
56+
57+
st.end();
6058
});
6159

62-
it('should skip forwards', function () {
60+
t.test('should skip forwards', function (st) {
6361
var values = [0, 1, 2, 3];
6462
var n = -1;
6563
var context = {};
6664

6765
context.children = [0, 1, 3];
6866

6967
modifyChildren(function (child, index, parent) {
70-
equal(child, values[++n]);
68+
st.strictEqual(child, values[++n]);
7169

7270
if (child === 1) {
7371
parent.children.splice(index + 1, 0, 2);
7472
return index + 1;
7573
}
7674
})(context);
7775

78-
deepEqual(context.children, values);
76+
st.deepEqual(context.children, values);
77+
78+
st.end();
7979
});
8080

81-
it('should skip backwards', function () {
81+
t.test('should skip backwards', function (st) {
8282
var invocations = [0, 1, -1, 0, 1, 2, 3];
8383
var n = -1;
8484
var context = {};
@@ -87,7 +87,7 @@ describe('modifyChildren()', function () {
8787
context.children = [0, 1, 2, 3];
8888

8989
modifyChildren(function (child, index, parent) {
90-
equal(child, invocations[++n]);
90+
st.strictEqual(child, invocations[++n]);
9191

9292
if (!inserted && child === 1) {
9393
inserted = true;
@@ -96,6 +96,10 @@ describe('modifyChildren()', function () {
9696
}
9797
})(context);
9898

99-
deepEqual(context.children, [-1, 0, 1, 2, 3]);
99+
st.deepEqual(context.children, [-1, 0, 1, 2, 3]);
100+
101+
st.end();
100102
});
103+
104+
t.end();
101105
});

0 commit comments

Comments
 (0)