HttpProvider support clone() (#3949)
* HttpProvider support clone() * fix lint
This commit is contained in:
@@ -29,6 +29,14 @@ describe('Http', (): void => {
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
it('allow clone', (): void => {
|
||||
const clone = http.clone();
|
||||
/* eslint-disable */
|
||||
expect((clone as any)['#endpoint']).toEqual((http as any)['#endpoint']);
|
||||
expect((clone as any)['#headers']).toEqual((http as any)['#headers']);
|
||||
/* eslint-enable */
|
||||
});
|
||||
|
||||
it('always returns isConnected true', (): void => {
|
||||
expect(http.isConnected).toEqual(true);
|
||||
});
|
||||
|
||||
@@ -62,7 +62,7 @@ export class HttpProvider implements ProviderInterface {
|
||||
* @description Returns a clone of the object
|
||||
*/
|
||||
public clone (): HttpProvider {
|
||||
throw new Error('Unimplemented');
|
||||
return new HttpProvider(this.#endpoint, this.#headers);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user