import assert = require("power-assert");
describe("TestModel", () => {
it("can instantiate", () => {
let model = new TestModel("AAA");
assert(!!model);
});
describe("toString()", () => {
it("should return string", () => {
const model = new TestModel("AAA");
const str = model.toString();
assert(typeof str === "string");
});
});
});
import assert = require("power-assert");
import {async, inject} from "angular2-testing-lite/core";
import {it, describe, xdescribe, beforeEach, beforeEachProviders} from "angular2-testing-lite/mocha";
describe("TestService", () => {
beforeEachProviders(() => [
BaseRequestOptions,
MockBackend,
provide(Http, {
useFactory: (backend: MockBackend, options: BaseRequestOptions) => {
return new Http(backend, options);
}, deps: [MockBackend, BaseRequestOptions]
}),
TestService
]);
it("can instantiate", inject([TestService], (service: TestService) => {
assert(!!service);
}));
});
import assert = require("power-assert");
import {inject, async, TestComponentBuilder} from "angular2-testing-lite/core";
import {describe, it, xit, beforeEachProviders, beforeEach} from "angular2-testing-lite/mocha";
import {HTTP_PROVIDERS} from "@angular/http";
describe("TestAppComponent", () => {
beforeEachProviders(() => [
HTTP_PROVIDERS,
TestService,
]);
it("can create", async(inject([TestComponentBuilder],
(tcb: TestComponentBuilder) => {
return tcb.createAsync(TestAppComponent)
.then(fixture => {
assert(!!fixture);
});
})
));
});