forked from neild3r/vscode-php-docblocker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproperties.test.ts
40 lines (34 loc) · 1.29 KB
/
properties.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
31
32
33
34
35
36
37
38
39
40
import * as assert from 'assert';
import {TextEditor, TextDocument} from 'vscode';
import Helper from './helpers';
import Function from '../src/block/property';
import {Doc, Param} from '../src/doc';
suite("Property tests", () => {
let editor:TextEditor;
let document:TextDocument;
let testPositions:any = {};
let map = Helper.getFixtureMap('properties.php.json');
suiteSetup(function(done) {
Helper.loadFixture('properties.php', (edit:TextEditor, doc:TextDocument) => {
editor = edit;
document = doc;
testPositions = Helper.getFixturePositions(document);
done();
});
});
map.forEach(testData => {
test("Match Test: "+ testData.name, () => {
let func = new Function(testPositions[testData.key], editor);
assert.equal(func.test(), true, test.name);
});
test("Parse Test: "+ testData.name, () => {
let func = new Function(testPositions[testData.key], editor);
assert.ok(func.parse(), test.name);
});
test("Type Test: "+ testData.name, () => {
let func = new Function(testPositions[testData.key], editor);
let doc:Doc = func.parse();
assert.equal(doc.var, testData.var, test.name);
});
});
});