1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
squid-js/test/mocks/AquariusConnector.mock.ts
2018-11-01 13:24:41 +01:00

26 lines
665 B
TypeScript

import AquariusConnector from "../../src/aquarius/AquariusConnector"
// @ts-ignore
export default class AquariusConnectorMock extends AquariusConnector {
constructor(private returnData: any) {
super()
}
// @ts-ignore
private async fetch(url, opts): Promise<any> {
return new Promise((resolve, reject) => {
resolve({
ok: true,
json: () => {
return this.returnData ? this.returnData : []
},
text: () => {
return this.returnData ? this.returnData.toString() : ""
},
})
})
}
}