Skip to content

Commit

Permalink
Added unittests for toasty container
Browse files Browse the repository at this point in the history
  • Loading branch information
akserg committed Feb 18, 2016
1 parent ed72921 commit 7e19ca8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions tests/toasty.container.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {
describe,
expect,
beforeEach,
it,
inject,
injectAsync,
beforeEachProviders
} from 'angular2/testing';

import {Observable} from 'rxjs/Observable';

import {ToastyConfig} from '../src/toasty.config';
import {ToastyService, Toast, ToastyOptions} from '../src/toasty.service';
import {ToastyContainer} from '../src/toasty.container';

export function main() {
describe('ToastyContainer', () => {

let container:ToastyContainer;

beforeEachProviders(() => {
return [
ToastyService, ToastyConfig
];
});

beforeEach(
inject([ToastyConfig, ToastyService], (config:ToastyConfig, service:ToastyService) => {
container = new ToastyContainer(config, service);
})
);

it('is defined', () => {
expect(container).toBeDefined();
});

});
}
2 changes: 1 addition & 1 deletion tests/toasty.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {ToastyConfig} from '../src/toasty.config';
import {ToastyService, Toast, ToastyOptions} from '../src/toasty.service';

export function main() {
describe('Ng2ToastyService', () => {
describe('ToastyService', () => {

beforeEachProviders(() => {
return [
Expand Down

0 comments on commit 7e19ca8

Please sign in to comment.