fix(http): Update types for TypeScript nullability support

This reverts commit 268884296a.
This commit is contained in:
Miško Hevery
2017-04-17 11:12:53 -07:00
committed by Tobias Bosch
parent 014594fe8f
commit ec028b8109
18 changed files with 138 additions and 128 deletions

View File

@ -59,13 +59,14 @@ export function main() {
]);
backend = injector.get(JSONPBackend);
const base = new BaseRequestOptions();
sampleRequest = new Request(base.merge(new RequestOptions({url: 'https://google.com'})));
sampleRequest =
new Request(base.merge(new RequestOptions({url: 'https://google.com'})) as any);
});
afterEach(() => { existingScripts = []; });
it('should create a connection', () => {
let instance: JSONPConnection;
let instance: JSONPConnection = undefined !;
expect(() => instance = backend.createConnection(sampleRequest)).not.toThrow();
expect(instance).toBeAnInstanceOf(JSONPConnection);
});
@ -146,8 +147,8 @@ export function main() {
RequestMethod.Head, RequestMethod.Patch]
.forEach(method => {
const base = new BaseRequestOptions();
const req = new Request(
base.merge(new RequestOptions({url: 'https://google.com', method: method})));
const req = new Request(base.merge(
new RequestOptions({url: 'https://google.com', method: method})) as any);
expect(() => new JSONPConnection_(req, new MockBrowserJsonp()).response.subscribe())
.toThrowError();
});