style(lint): re-format modules/@angular
This commit is contained in:
@ -1,23 +1,10 @@
|
||||
import {Component, provide} from '@angular/core';
|
||||
import {UrlResolver, XHR} from '@angular/compiler';
|
||||
import {
|
||||
beforeEach,
|
||||
beforeEachProviders,
|
||||
ddescribe,
|
||||
describe,
|
||||
iit,
|
||||
inject,
|
||||
it,
|
||||
xit
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
import {expect} from '@angular/platform-browser/testing';
|
||||
import {Component, provide} from '@angular/core';
|
||||
import {beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||
import {
|
||||
fakeAsync,
|
||||
flushMicrotasks,
|
||||
Log,
|
||||
tick,
|
||||
} from '@angular/core/testing';
|
||||
import {expect} from '@angular/platform-browser/testing';
|
||||
|
||||
import {fakeAsync, flushMicrotasks, Log, tick,} from '@angular/core/testing';
|
||||
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
||||
import {BaseException} from '../../src/facade/exceptions';
|
||||
import {CachedXHR} from '../../src/xhr/xhr_cache';
|
||||
@ -31,29 +18,30 @@ export function main() {
|
||||
setTemplateCache({'test.html': '<div>Hello</div>'});
|
||||
return new CachedXHR();
|
||||
}
|
||||
beforeEachProviders(() => [
|
||||
{provide: UrlResolver, useClass: TestUrlResolver},
|
||||
{provide: XHR, useFactory: createCachedXHR}
|
||||
]);
|
||||
beforeEachProviders(() => [{provide: UrlResolver, useClass: TestUrlResolver}, {
|
||||
provide: XHR,
|
||||
useFactory: createCachedXHR
|
||||
}]);
|
||||
|
||||
it('should throw exception if $templateCache is not found', () => {
|
||||
setTemplateCache(null);
|
||||
expect(() => { xhr = new CachedXHR(); })
|
||||
.toThrowErrorWith('CachedXHR: Template cache was not found in $templateCache.');
|
||||
expect(() => {
|
||||
xhr = new CachedXHR();
|
||||
}).toThrowErrorWith('CachedXHR: Template cache was not found in $templateCache.');
|
||||
});
|
||||
|
||||
it('should resolve the Promise with the cached file content on success',
|
||||
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
|
||||
setTemplateCache({'test.html': '<div>Hello</div>'});
|
||||
xhr = new CachedXHR();
|
||||
xhr.get('test.html')
|
||||
.then((text) => {
|
||||
expect(text).toEqual('<div>Hello</div>');
|
||||
async.done();
|
||||
});
|
||||
xhr.get('test.html').then((text) => {
|
||||
expect(text).toEqual('<div>Hello</div>');
|
||||
async.done();
|
||||
});
|
||||
}));
|
||||
|
||||
it('should reject the Promise on failure', inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
|
||||
it('should reject the Promise on failure',
|
||||
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
|
||||
xhr = new CachedXHR();
|
||||
xhr.get('unknown.html')
|
||||
.then((text) => { throw new BaseException('Not expected to succeed.'); })
|
||||
|
@ -1,16 +1,7 @@
|
||||
import {
|
||||
beforeEach,
|
||||
ddescribe,
|
||||
describe,
|
||||
expect,
|
||||
iit,
|
||||
inject,
|
||||
it,
|
||||
xit,
|
||||
AsyncTestCompleter
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
import {XHRImpl} from '../../src/xhr/xhr_impl';
|
||||
import {AsyncTestCompleter, beforeEach, ddescribe, describe, expect, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
|
||||
import {PromiseWrapper} from '../../src/facade/async';
|
||||
import {XHRImpl} from '../../src/xhr/xhr_impl';
|
||||
|
||||
export function main() {
|
||||
describe('XHRImpl', () => {
|
||||
@ -35,7 +26,8 @@ export function main() {
|
||||
});
|
||||
}), 10000);
|
||||
|
||||
it('should reject the Promise on failure', inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
|
||||
it('should reject the Promise on failure',
|
||||
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
|
||||
PromiseWrapper.catchError(xhr.get(url404), (e) => {
|
||||
expect(e).toEqual(`Failed to load ${url404}`);
|
||||
async.done();
|
||||
|
Reference in New Issue
Block a user