-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.js
49 lines (44 loc) · 1 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
import { ast, text, html, md } from "./index";
import should from "should";
const input = `
# header ~~removed string~~
`;
const mdast = {
type: "root",
children: [
{
type: "heading",
depth: 1,
children: [
{
type: "text",
value: "header"
}
]
}
]
};
it('ast markdown', () => {
ast(input).should.have.a.property("type").which.is.equal('root');
});
it('text markdown', () => {
text(input).should.be.equal('header removed string');
});
it('html markdown', () => {
html(input).should.be.equal('<h1>header <del>removed string</del></h1>');
});
it('md markdown', () => {
md(input).should.be.equal('# header ~~removed string~~');
});
it('ast mdast', () => {
ast(mdast).should.have.a.property("type").which.is.equal('root');
});
it('text mdast', () => {
text(mdast).should.be.equal('header');
});
it('html mdast', () => {
html(mdast).should.be.equal('<h1>header</h1>');
});
it('md mdast', () => {
md(mdast).should.be.equal('# header');
});