Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update deprecated test functions #842

Merged
merged 1 commit into from
Aug 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/app/about/about.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ import { TestComponentBuilder } from '@angular/compiler/testing';
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import {
beforeEachProviders,
describe,
inject,
it
addProviders,
inject
} from '@angular/core/testing';

// Load the implementations that should be tested
import { About } from './about.component';

describe('About', () => {
// provide our implementations or mocks to the dependency injector
beforeEachProviders(() => [
beforeEach(() => addProviders([
// provide a better mock
{
provide: ActivatedRoute,
Expand All @@ -24,7 +22,7 @@ describe('About', () => {
}
},
About
]);
]));

it('should log ngOnInit', inject([ About ], (about) => {
spyOn(console, 'log');
Expand Down
9 changes: 4 additions & 5 deletions src/app/app.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
beforeEachProviders,
inject,
it
addProviders,
inject
} from '@angular/core/testing';

// Load the implementations that should be tested
Expand All @@ -10,10 +9,10 @@ import { AppState } from './app.service';

describe('App', () => {
// provide our implementations or mocks to the dependency injector
beforeEachProviders(() => [
beforeEach(() => addProviders([
AppState,
App
]);
]));

it('should have a url', inject([ App ], (app) => {
expect(app.url).toEqual('https://twitter.com/AngularClass');
Expand Down
10 changes: 4 additions & 6 deletions src/app/home/home.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {
beforeEachProviders,
describe,
inject,
it
addProviders,
inject
} from '@angular/core/testing';
import { Component } from '@angular/core';
import { BaseRequestOptions, Http } from '@angular/http';
Expand All @@ -15,7 +13,7 @@ import { Title } from './title';

describe('Home', () => {
// provide our implementations or mocks to the dependency injector
beforeEachProviders(() => [
beforeEach(() => addProviders([
BaseRequestOptions,
MockBackend,
{
Expand All @@ -29,7 +27,7 @@ describe('Home', () => {
AppState,
Title,
Home
]);
]));

it('should have default data', inject([ Home ], (home) => {
expect(home.localState).toEqual({ value: '' });
Expand Down
9 changes: 4 additions & 5 deletions src/app/home/title/title.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
beforeEachProviders,
inject,
it
addProviders,
inject
} from '@angular/core/testing';
import { TestComponentBuilder } from '@angular/compiler/testing';
import { Component } from '@angular/core';
Expand All @@ -11,7 +10,7 @@ import { MockBackend } from '@angular/http/testing';
import { Title } from './title.service';

describe('Title', () => {
beforeEachProviders(() => [
beforeEach(() => addProviders([
BaseRequestOptions,
MockBackend,
{
Expand All @@ -23,7 +22,7 @@ describe('Title', () => {
},

Title
]);
]));


it('should have http', inject([ Title ], (title) => {
Expand Down
6 changes: 2 additions & 4 deletions src/app/home/x-large/x-large.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import {
async,
beforeEachProviders,
describe,
inject,
it
addProviders,
inject
} from '@angular/core/testing';
import { TestComponentBuilder } from '@angular/compiler/testing';
import { Component } from '@angular/core';
Expand Down