-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
92 lines (84 loc) · 2.25 KB
/
Copy pathtest.js
File metadata and controls
92 lines (84 loc) · 2.25 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
var processTags = require("bit-docs-process-tags");
var diff = require("../diff");
var path = require("path");
var assert = require("assert");
describe("diff", function(){
it("adds to adds diff lines to parent",function(){
var docMap = {};
processTags({
comment: "@constructor\n@diff ./dir1/hello-world1.js ./dir2/hello-world2.js",
scope: {},
docMap: docMap,
docObject: {
src: {
path: path.join(__dirname, "test.js")
}
},
tags: {
diff: diff,
constructor: {
add : function(){
this.name = "constructed";
this.type = "constructor";
return ["scope", this];
}
}
}
},function(newDoc, newScope){
// console.log(newDoc.body);
assert.ok(newDoc.body.indexOf('<div line-highlight="2,"></div>') >= 0);
});
});
it("adds to adds 'only' after lines if only flag is present",function(){
var docMap = {};
processTags({
comment: "@constructor\n@diff ./dir1/hello-world1.js ./dir2/hello-world2.js only",
scope: {},
docMap: docMap,
docObject: {
src: {
path: path.join(__dirname, "test.js")
}
},
tags: {
diff: diff,
constructor: {
add : function(){
this.name = "constructed";
this.type = "constructor";
return ["scope", this];
}
}
}
},function(newDoc, newScope){
// console.log('test 2', newDoc.body);
assert.ok(newDoc.body.indexOf('<div line-highlight="2,only"></div>') >= 0);
});
});
it("checks advanced file",function(){
var docMap = {};
processTags({
comment: "@constructor\n@diff ./dir1/ngfile.service.spec.ts ./dir2/ngfile.service.spec.ts",
scope: {},
docMap: docMap,
docObject: {
src: {
path: path.join(__dirname, "test.js")
}
},
tags: {
diff: diff,
constructor: {
add : function(){
this.name = "constructed";
this.type = "constructor";
return ["scope", this];
}
}
}
},function(newDoc, newScope){
// console.log('test 3', newDoc.body);
assert.ok(newDoc.body.indexOf('<div line-highlight="3-5,80-81,93-123,"></div>') >= 0);
});
});
});