forked from neild3r/vscode-php-docblocker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass.test.ts
34 lines (29 loc) · 1.04 KB
/
class.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
import * as assert from 'assert';
import {TextEditor, TextDocument} from 'vscode';
import Helper from './helpers';
import Class from '../src/block/class';
import {Doc, Param} from '../src/doc';
suite("Class tests", () => {
let editor:TextEditor;
let document:TextDocument;
let testPositions:any = {};
let map = Helper.getFixtureMap('classes.php.json');
suiteSetup(function(done) {
Helper.loadFixture('classes.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 Class(testPositions[testData.key], editor);
assert.equal(func.test(), true, test.name);
});
test("Parse Test: "+ testData.name, () => {
let func = new Class(testPositions[testData.key], editor);
assert.ok(func.parse(), test.name);
});
});
});