forked from neild3r/vscode-php-docblocker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoc.test.ts
30 lines (28 loc) · 986 Bytes
/
doc.test.ts
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
import * as assert from 'assert';
import {SnippetString} from 'vscode';
import Helper from './helpers';
import {Doc, Param} from '../src/doc';
import Config from '../src/util/config';
suite("Snippet build tests", () => {
let map = Helper.getFixtureMap('doc.json');
map.forEach(testData => {
test("Snippet test: "+ testData.name, () => {
let doc = new Doc();
let empty = false;
if (testData.config != undefined) {
Helper.setConfig(testData.config);
} else {
Config.instance.load();
}
if (testData.input != undefined) {
doc.fromObject(testData.input);
} else {
empty = true;
}
if (Config.instance.get('template')) {
doc.template = Config.instance.get('template');
}
assert.equal(doc.build(empty).value, testData.expected.join("\n"));
});
});
});