-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppTest.ts
34 lines (30 loc) · 881 Bytes
/
AppTest.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 "reflect-metadata";
import {Suite} from "mocha";
import {expect} from "chai";
import {Factory, Logger, LogLevel} from "../src";
import {AbstractApp} from "../src/com/domwires/core/app/AbstractApp";
describe('AppTest', function (this: Suite)
{
class MockApp extends AbstractApp<{ name: string; age: number }>
{
}
it('testAppConfig', (done) =>
{
const f = new Factory(new Logger(LogLevel.VERBOSE));
const app = f.getInstance<MockApp>(MockApp);
app.loadConfig(success =>
{
try
{
expect(success).true;
expect(app.appConfigJson.name).equals("Anton");
expect(app.appConfigJson.age).equals(36);
done();
} catch (e)
{
console.error(e);
throw e;
}
});
});
});