message: ipfs plugin test method options provider
diff: @@ -162,4 +162,48 @@ describe("IPFS Plugin", () => {
  expect(resultForOverride.error?.stack).toMatch("Timeout has been reached");
  expect(resultForOverride.error?.stack).toMatch("Timeout: 500");
  });
  +
  + it("Should use provider from method options", async () => {
  + const clientWithBadProvider = new PolywrapClient({
  + plugins: [
  + {
  + uri: "wrap://ens/ipfs.polywrap.eth",
  + plugin: ipfsPlugin({}),
  + },
  + ],
  + envs: [
  + {
  + uri: "wrap://ens/ipfs.polywrap.eth",
  + env: {
  + provider: "this-provider-doesnt-exist",
  + },
  + },
  + ],
  + });
  +
  + const catResult = await Ipfs_Module.cat(
  + {
  + cid: sampleFileIpfsInfo.hash.toString(),
  + options: { provider: providers.ipfs },
  + },
  + clientWithBadProvider
  + );
  +
  + expect(catResult.error).toBeFalsy();
  + expect(catResult.data).toEqual(sampleFileBuffer);
  +
  + const resolveResult = await Ipfs_Module.resolve(
  + {
  + cid: sampleFileIpfsInfo.hash.toString(),
  + options: { provider: providers.ipfs },
  + },
  + clientWithBadProvider
  + );
  +
  + expect(resolveResult.error).toBeFalsy();
  + expect(resolveResult.data).toEqual({
  + cid: `/ipfs/${sampleFileIpfsInfo.hash.toString()}`,
  + provider: providers.ipfs,
  + });
  + });
  });
  