-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
58 lines (49 loc) · 1.47 KB
/
test.js
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
import assert from 'node:assert/strict'
import test from 'node:test'
import {phrasing} from 'mdast-util-phrasing'
test('phrasing', async function (t) {
await t.test('should expose the public api', async function () {
assert.deepEqual(Object.keys(await import('mdast-util-phrasing')).sort(), [
'phrasing'
])
})
await t.test('should return `false` without node', async function () {
assert.equal(phrasing(), false)
})
await t.test('should return `false` with `null`', async function () {
assert.equal(phrasing(null), false)
})
await t.test(
'should return `false` when without known `node`',
async function () {
assert.equal(phrasing({type: 'foo'}), false)
}
)
await t.test(
'should return `true` when with a phrasing `node`',
async function () {
assert.equal(phrasing({type: 'link'}), true)
}
)
await t.test(
'should return `true` when with another phrasing `node`',
async function () {
assert.equal(phrasing({type: 'strong'}), true)
}
)
await t.test(
'should return `false` when with a block `node`',
async function () {
assert.equal(phrasing({type: 'paragraph'}), false)
}
)
await t.test(
'should return `false` when with another block `node`',
async function () {
assert.equal(phrasing({type: 'list'}), false)
}
)
await t.test('should support common extensions', async function () {
assert.equal(phrasing({type: 'textDirective'}), true)
})
})