mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
26 lines
681 B
TypeScript
26 lines
681 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 ? JSON.stringify(this.returnData.toString()) : ""
|
|
},
|
|
})
|
|
})
|
|
}
|
|
}
|