Skip to content

Commit f7fb623

Browse files
author
Richard Smith-Unna
authoredFeb 27, 2017
Merge pull request #1 from blahah/ch-ch-changes
Update docs, dev-dependencies
2 parents edcce50 + bb3a7f1 commit f7fb623

File tree

4 files changed

+34
-38
lines changed

4 files changed

+34
-38
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ remark()
3131
}))
3232
}
3333
})
34-
.process('Some _emphasis_, **strongness**, and `code`.')
34+
.processSync('Some _emphasis_, **strongness**, and `code`.')
3535

3636
```
3737

‎example.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ remark()
1616
}))
1717
}
1818
})
19-
.process('Some _emphasis_, **strongness**, and `code`.')
19+
.processSync('Some _emphasis_, **strongness**, and `code`.')

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
"author": "Richard Smith-Unna <rik@fathomlabs.io> @blahah",
2222
"license": "MIT",
2323
"devDependencies": {
24-
"standard": "^7.1.2",
24+
"remark": "^7.0.0",
25+
"standard": "^8.0.0",
2526
"tape": "^4.6.0"
2627
},
2728
"dependencies": {
2829
"lodash.iteratee": "^4.5.0",
29-
"remark": "^5.0.1",
3030
"unist-util-visit": "^1.1.0"
3131
}
3232
}

‎test.js

+30-34
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,48 @@ var test = require('tape')
22
var remark = require('remark')
33
var find = require('./index.js')
44

5-
remark()
6-
.use(function () { return run })
7-
.process('Some _emphasis_, **strongness**, and `code`.')
5+
test('unist-find', function (t) {
6+
var tree = remark().parse('Some _emphasis_, **strongness**, and `code`.')
87

9-
function run (tree) {
10-
test('unist-find', function (t) {
11-
t.throws(function () {
12-
find()
13-
}, 'should fail without tree')
8+
t.throws(function () {
9+
find()
10+
}, 'should fail without tree')
1411

15-
t.throws(function () {
16-
find(tree)
17-
}, 'should fail without condition')
12+
t.throws(function () {
13+
find(tree)
14+
}, 'should fail without condition')
1815

19-
t.test('should find with string condition', function (st) {
20-
var result = find(tree, 'value')
16+
t.test('should find with string condition', function (st) {
17+
var result = find(tree, 'value')
2118

22-
st.equal(result, tree.children[0].children[0])
19+
st.equal(result, tree.children[0].children[0])
2320

24-
st.end()
25-
})
21+
st.end()
22+
})
2623

27-
t.test('should find with object condition', function (st) {
28-
var result = find(tree, { type: 'emphasis' })
24+
t.test('should find with object condition', function (st) {
25+
var result = find(tree, { type: 'emphasis' })
2926

30-
st.equal(result, tree.children[0].children[1])
27+
st.equal(result, tree.children[0].children[1])
3128

32-
st.end()
33-
})
29+
st.end()
30+
})
3431

35-
t.test('should find with function condition', function (st) {
36-
var result = find(tree, function (node) {
37-
return node.type === 'inlineCode'
38-
})
32+
t.test('should find with function condition', function (st) {
33+
var result = find(tree, function (node) {
34+
return node.type === 'inlineCode'
35+
})
3936

40-
st.equal(result, tree.children[0].children[5])
37+
st.equal(result, tree.children[0].children[5])
4138

42-
st.end()
43-
})
39+
st.end()
40+
})
4441

45-
t.test('should return undefined if no matches', function (st) {
46-
var result = find(tree, 'nope, nope, nope')
42+
t.test('should return undefined if no matches', function (st) {
43+
var result = find(tree, 'nope, nope, nope')
4744

48-
st.equal(result, undefined)
45+
st.equal(result, undefined)
4946

50-
st.end()
51-
})
47+
st.end()
5248
})
53-
}
49+
})

0 commit comments

Comments
 (0)
Please sign in to comment.