fix(http): Update types for TypeScript nullability support
This reverts commit 268884296a
.
This commit is contained in:

committed by
Tobias Bosch

parent
014594fe8f
commit
ec028b8109
@ -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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user