-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtest.js
29 lines (25 loc) · 911 Bytes
/
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
const { generate } = require("../out/JsDocGenerator")
const { transpilePaths } = require("../out/util")
const path = require("path")
test("interface from namespace", () => {
return transpilePaths([path.join(__dirname, "fixtures")], async (basePath, config, tsConfig) => {
const generator = generate(basePath, config, "test", null)
let result = ""
for (const [moduleId, psi] of generator.moduleNameToResult.entries()) {
for (const d of psi.members) {
result += generator.renderer.renderVariable(d)
}
for (const d of psi.classes) {
result += generator.renderer.processClassOrInterface(d, new Map())
}
for (const d of psi.functions) {
result += generator.renderer.renderMethod(d)
}
result = `/**
* @module ${moduleId}
*/
${result}`
}
expect(result).toMatchSnapshot()
})
});