diff --git a/packages/cli/src/__tests__/e2e/build.spec.ts b/packages/cli/src/__tests__/e2e/build.spec.ts index 6a651ee2ff..83f985463d 100644 --- a/packages/cli/src/__tests__/e2e/build.spec.ts +++ b/packages/cli/src/__tests__/e2e/build.spec.ts @@ -180,7 +180,7 @@ describe("e2e tests for build command", () => { expect(error).toBe(""); expect(code).toEqual(0); expect(output).toContain(`Artifacts written to ${buildDir}`); - expect(output).toContain(`Manifest written to ${buildDir}/polywrap.json`); + expect(output).toContain(`Manifest written to ${buildDir}/wrap.info`); testBuildOutput(testCaseDir, outputDir); }); diff --git a/packages/js/client/src/__tests__/core/wasm-wrapper.spec.ts b/packages/js/client/src/__tests__/core/wasm-wrapper.spec.ts index 8753e8795f..25e4c57c00 100644 --- a/packages/js/client/src/__tests__/core/wasm-wrapper.spec.ts +++ b/packages/js/client/src/__tests__/core/wasm-wrapper.spec.ts @@ -14,6 +14,7 @@ import { Subscription } from "../.."; import { GetPathToTestWrappers } from "@polywrap/test-cases"; +import fs from "fs"; jest.setTimeout(200000); @@ -22,8 +23,8 @@ describe("wasm-wrapper", () => { let ethProvider: string; let ensAddress: string; - const wrapperPath = `${GetPathToTestWrappers()}/wasm-as/simple-storage` - const wrapperUri = `fs/${wrapperPath}/build` + const wrapperPath = `${GetPathToTestWrappers()}/wasm-as/simple-storage`; + const wrapperUri = `fs/${wrapperPath}/build`; beforeAll(async () => { await initTestEnvironment(); @@ -229,18 +230,25 @@ describe("wasm-wrapper", () => { test("getFile -- simple-storage polywrap", async () => { const client = await getClient(); + const expectedSchema = await fs.promises.readFile( + `${wrapperPath}/build/schema.graphql`, + "utf8" + ); + const fileStr: string = (await client.getFile(wrapperUri, { path: "./schema.graphql", encoding: "utf8", })) as string; - expect(fileStr).toContain(`type Module @imports`); + + expect(fileStr).toEqual(expectedSchema); const fileBuffer: Uint8Array = (await client.getFile(wrapperUri, { path: "./schema.graphql", })) as Uint8Array; const decoder = new TextDecoder("utf8"); const text = decoder.decode(fileBuffer); - expect(text).toContain(`type Module @imports`); + + expect(text).toEqual(expectedSchema); await expect(() => client.getFile(new Uri("wrap://ens/ipfs.polywrap.eth"), { @@ -306,8 +314,8 @@ describe("wasm-wrapper", () => { args: { address: address, connection: { - networkNameOrChainId: "testnet" - } + networkNameOrChainId: "testnet", + }, }, frequency: { ms: 4500 }, }); @@ -384,8 +392,8 @@ describe("wasm-wrapper", () => { args: { address: address, connection: { - networkNameOrChainId: "testnet" - } + networkNameOrChainId: "testnet", + }, }, frequency: { ms: 4500 }, }); diff --git a/packages/js/plugins/uri-resolvers/file-system-resolver/src/__tests__/e2e.spec.ts b/packages/js/plugins/uri-resolvers/file-system-resolver/src/__tests__/e2e.spec.ts index 07b617de33..540591662f 100644 --- a/packages/js/plugins/uri-resolvers/file-system-resolver/src/__tests__/e2e.spec.ts +++ b/packages/js/plugins/uri-resolvers/file-system-resolver/src/__tests__/e2e.spec.ts @@ -82,8 +82,8 @@ describe("Filesystem plugin", () => { method: "deployContract", args: { connection: { - networkNameOrChainId: "testnet" - } + networkNameOrChainId: "testnet", + }, }, }); @@ -105,17 +105,16 @@ describe("Filesystem plugin", () => { expect(manifest).toBeTruthy(); expect(manifest.version).toBe("0.0.1"); + expect(manifest.type).toEqual("wasm"); // get a file const file = await client.getFile(fsUri, { path: "wrap.info", }); - const expectedFile = await fs.promises.readFile( - `${fsPath}/wrap.info` - ); + const expectedFile = await fs.promises.readFile(`${fsPath}/wrap.info`); - const expectedInfo = Uint8Array.from(expectedFile) + const expectedInfo = Uint8Array.from(expectedFile); expect(file).toStrictEqual(expectedInfo); }); });