Skip to content

Commit f1846bc

Browse files
committed
chore: update client tests
1 parent aa85684 commit f1846bc

4 files changed

Lines changed: 18 additions & 41 deletions

File tree

.github/workflows/ci-javascript.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ jobs:
128128

129129
- if: ${{ needs.CI-WRAP-Test-Harness.outputs.rebuild_required == 'true' }}
130130
run: |
131-
rm -rf packages/test-cases/cases/wrappers
132-
mv wrappers packages/test-cases/cases
131+
rm -rf packages/test-cases/wrappers
132+
mv wrappers packages/test-cases
133133
134134
- name: Test
135135
run: yarn test

packages/client/src/__tests__/core/error-structure.spec.ts

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Uri } from "@polywrap/core-js";
55
import { GetPathToTestWrappers } from "@polywrap/test-cases";
66
import { PolywrapClient } from "../..";
77
import { WrapError, WrapErrorCode } from "@polywrap/core-js";
8-
import { incompatiblePlugin, mockPluginRegistration } from "../helpers";
8+
import { mockPluginRegistration } from "../helpers";
99
import { msgpackDecode, msgpackEncode } from "@polywrap/msgpack-js";
1010
import {
1111
ClientConfigBuilder,
@@ -52,7 +52,7 @@ describe("Error structure", () => {
5252
expect(result.error?.reason).toContain("A URI Resolver returned an error.");
5353
expect(
5454
result.error?.uri.endsWith(
55-
"packages/test-cases/wrappers/subinvoke/00-subinvoke/implementations/as-not-found"
55+
"packages/test-cases/build/../wrappers/subinvoke/00-subinvoke/implementations/as-not-found"
5656
)
5757
).toBeTruthy();
5858
expect(result.error?.resolutionStack).toBeTruthy();
@@ -75,7 +75,7 @@ describe("Error structure", () => {
7575
expect(result.error?.reason).toContain("SubInvocation exception encountered");
7676
expect(
7777
result.error?.uri.endsWith(
78-
"packages/test-cases/wrappers/subinvoke/02-consumer/implementations/as"
78+
"packages/test-cases/build/../wrappers/subinvoke/02-consumer/implementations/as"
7979
)
8080
).toBeTruthy();
8181
expect(result.error?.method).toEqual("throwError");
@@ -116,7 +116,7 @@ describe("Error structure", () => {
116116
expect(result.error?.reason.startsWith("__wrap_abort:")).toBeTruthy();
117117
expect(
118118
result.error?.uri.endsWith(
119-
"packages/test-cases/wrappers/subinvoke/00-subinvoke/implementations/as"
119+
"packages/test-cases/build/../wrappers/subinvoke/00-subinvoke/implementations/as"
120120
)
121121
).toBeTruthy();
122122
expect(result.error?.method).toEqual("add");
@@ -145,7 +145,7 @@ describe("Error structure", () => {
145145
).toBeTruthy();
146146
expect(
147147
result.error?.uri.endsWith(
148-
"packages/test-cases/wrappers/subinvoke/00-subinvoke/implementations/as"
148+
"packages/test-cases/build/../wrappers/subinvoke/00-subinvoke/implementations/as"
149149
)
150150
).toBeTruthy();
151151
expect(result.error?.method).toEqual("notExistingMethod");
@@ -188,7 +188,7 @@ describe("Error structure", () => {
188188
).toBeTruthy();
189189
expect(
190190
result.error?.uri.endsWith(
191-
"packages/test-cases/wrappers/subinvoke/02-consumer/implementations/as"
191+
"packages/test-cases/build/../wrappers/subinvoke/02-consumer/implementations/as"
192192
)
193193
).toBeTruthy();
194194
expect(result.error?.method).toEqual("throwError");
@@ -264,29 +264,6 @@ describe("Error structure", () => {
264264
);
265265
});
266266

267-
test.skip("Invoke a plugin with incompatible version", async () => {
268-
const builder = new ClientConfigBuilder();
269-
const config = builder
270-
.addPackage("wrap://ens/plugin.eth", incompatiblePlugin())
271-
.build();
272-
const client = new PolywrapClient(config);
273-
const result = await client.invoke<string>({
274-
uri: "wrap://ens/plugin.eth",
275-
method: "getData",
276-
});
277-
278-
expect(result.ok).toBeFalsy();
279-
if (result.ok) throw Error("should never happen");
280-
281-
expect(result.error?.name).toEqual("WrapError");
282-
expect(result.error?.code).toEqual(WrapErrorCode.URI_RESOLVER_ERROR);
283-
expect(result.error?.uri.endsWith("plugin.eth")).toBeTruthy();
284-
expect(result.error?.resolutionStack).toBeDefined();
285-
expect(`${result.error?.cause}`).toContain(
286-
`Unrecognized WrapManifest schema version "0.0.0.5"`
287-
);
288-
});
289-
290267
afterAll(() => {
291268
fs.rmdirSync("tmp", { recursive: true });
292269
});
@@ -315,7 +292,7 @@ describe("Error structure", () => {
315292
expect(result.error?.reason.startsWith("__wrap_abort:")).toBeTruthy();
316293
expect(
317294
result.error?.uri.endsWith(
318-
"packages/test-cases/wrappers/subinvoke/00-subinvoke/implementations/rs"
295+
"packages/test-cases/build/../wrappers/subinvoke/00-subinvoke/implementations/rs"
319296
)
320297
).toBeTruthy();
321298
expect(result.error?.method).toEqual("add");
@@ -344,7 +321,7 @@ describe("Error structure", () => {
344321
).toBeTruthy();
345322
expect(
346323
result.error?.uri.endsWith(
347-
"packages/test-cases/wrappers/subinvoke/00-subinvoke/implementations/rs"
324+
"packages/test-cases/build/../wrappers/subinvoke/00-subinvoke/implementations/rs"
348325
)
349326
).toBeTruthy();
350327
expect(result.error?.method).toEqual("notExistingMethod");
@@ -387,7 +364,7 @@ describe("Error structure", () => {
387364
).toBeTruthy();
388365
expect(
389366
result.error?.uri.endsWith(
390-
"packages/test-cases/wrappers/subinvoke/02-consumer/implementations/rs"
367+
"packages/test-cases/build/../wrappers/subinvoke/02-consumer/implementations/rs"
391368
)
392369
).toBeTruthy();
393370
expect(result.error?.method).toEqual("throwError");
@@ -432,7 +409,7 @@ describe("Error structure", () => {
432409
uri: DefaultBundle.plugins.fileSystem.uri.uri,
433410
method: "readFile",
434411
args: {
435-
pathh: "packages/js/client/src/__tests__/core/index.ts",
412+
pathh: "packages/client/src/__tests__/core/index.ts",
436413
},
437414
});
438415

@@ -449,7 +426,7 @@ describe("Error structure", () => {
449426
expect(result.error?.uri).toEqual(DefaultBundle.plugins.fileSystem.uri.uri);
450427
expect(result.error?.method).toEqual("readFile");
451428
expect(result.error?.args).toContain(
452-
'{\n "pathh": "packages/js/client/src/__tests__/core/index.ts"\n}'
429+
'{\n "pathh": "packages/client/src/__tests__/core/index.ts"\n}'
453430
);
454431
expect(result.error?.source?.file).toEqual(
455432
"node:internal/fs/promises"
@@ -496,7 +473,7 @@ describe("Error structure", () => {
496473
expect(result.error?.uri).toEqual("wrap://plugin/mock");
497474
expect(
498475
result.error?.source?.file?.endsWith(
499-
"packages/js/client/src/__tests__/helpers.ts"
476+
"packages/client/src/__tests__/helpers.ts"
500477
)
501478
).toBeTruthy();
502479
expect(result.error?.source?.row).toEqual(47);

packages/uri-resolver-extensions/src/__tests__/wrappers/test-resolver/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "MIT"
88
edition = "2021"
99

1010
[dependencies]
11-
polywrap-wasm-rs = { version = "0.10.0-pre.8" }
11+
polywrap-wasm-rs = { version = "0.10.0" }
1212
serde = { version = "1.0", features = ["derive"] }
1313

1414
[lib]

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3972,9 +3972,9 @@ electron-fetch@^1.7.2:
39723972
encoding "^0.1.13"
39733973

39743974
electron-to-chromium@^1.4.284:
3975-
version "1.4.367"
3976-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.367.tgz#d9ddc529ba2315fc852b722c359e4a40e86aa742"
3977-
integrity sha512-mNuDxb+HpLhPGUKrg0hSxbTjHWw8EziwkwlJNkFUj3W60ypigLDRVz04vU+VRsJPi8Gub+FDhYUpuTm9xiEwRQ==
3975+
version "1.4.368"
3976+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.368.tgz#75901f97d3e23da2e66feb1e61fbb8e70ac96430"
3977+
integrity sha512-e2aeCAixCj9M7nJxdB/wDjO6mbYX+lJJxSJCXDzlr5YPGYVofuJwGN9nKg2o6wWInjX6XmxRinn3AeJMK81ltw==
39783978

39793979
elliptic@6.5.4:
39803980
version "6.5.4"

0 commit comments

Comments
 (0)