Skip to content

Commit 0868a6d

Browse files
committed
fix(test): fix wrong module references in test
1 parent 00f6795 commit 0868a6d

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

typegate/tests/runtimes/wasm/wasm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { Policy, t, typegraph } from "@typegraph/sdk";
55
import { WasmRuntime } from "@typegraph/sdk/runtimes/wasm.js";
66

7-
export const tg = await typegraph("wasm-ts", (g) => {
7+
export const tg = await typegraph("wasm-ts", (g: any) => {
88
const pub = Policy.public();
99
const wasm = new WasmRuntime();
1010
const entity = t.struct({

typegate/tests/runtimes/wasm/wasmedge_sync_test.ts renamed to typegate/tests/runtimes/wasm/wasm_sync_test.ts

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { BasicAuth, tgDeploy, tgRemove } from "@typegraph/sdk/tg_deploy.js";
55
import { gql, Meta } from "test-utils/mod.ts";
66
import { testDir } from "test-utils/dir.ts";
7-
import { tg } from "./wasmedge.ts";
7+
import { tg } from "./wasm.ts";
88
import * as path from "std/path/mod.ts";
99
import { connect } from "redis";
1010
import { S3Client } from "aws-sdk/client-s3";
@@ -45,12 +45,12 @@ const syncConfig = {
4545
s3Bucket: "metatype-sync-test",
4646
};
4747

48-
const cwd = path.join(testDir, "runtimes/wasmedge");
48+
const cwd = path.join(testDir, "runtimes/wasm");
4949
const auth = new BasicAuth("admin", "password");
5050

5151
Meta.test(
5252
{
53-
name: "WasmEdge Runtime typescript SDK: Sync Config",
53+
name: "Wasm Runtime typescript SDK: Sync Config",
5454
port: true,
5555
systemTypegraphs: true,
5656
syncConfig,
@@ -78,7 +78,7 @@ Meta.test(
7878
},
7979
dir: cwd,
8080
},
81-
typegraphPath: path.join(cwd, "wasmedge.ts"),
81+
typegraphPath: path.join(cwd, "wasm.ts"),
8282
secrets: {},
8383
});
8484

@@ -89,7 +89,7 @@ Meta.test(
8989
assertExists(serialized, "serialized has a value");
9090
assertEquals(gateResponseAdd, {
9191
data: {
92-
addTypegraph: { name: "wasmedge_ts", messages: [], migrations: [] },
92+
addTypegraph: { name: "wasm-ts", messages: [], migrations: [] },
9393
},
9494
});
9595

@@ -100,12 +100,14 @@ Meta.test(
100100
const engine = await metaTest.engineFromDeployed(serialized);
101101

102102
await gql`
103-
query {
104-
test_wasi_ts(a: 11, b: 2)
105-
}
106-
`
103+
query {
104+
add(a: 11, b: 2)
105+
range(a: 1, b: 4)
106+
}
107+
`
107108
.expectData({
108-
test_wasi_ts: 13,
109+
add: 13,
110+
range: [1, 2, 3, 4],
109111
})
110112
.on(engine);
111113

@@ -121,12 +123,14 @@ Meta.test(
121123
const engine = await metaTest.engineFromDeployed(serialized);
122124

123125
await gql`
124-
query {
125-
test_wasi_ts(a: 11, b: 12)
126-
}
127-
`
126+
query {
127+
add(a: 11, b: 2)
128+
range(a: 1, b: 4)
129+
}
130+
`
128131
.expectData({
129-
test_wasi_ts: 23,
132+
add: 13,
133+
range: [1, 2, 3, 4],
130134
})
131135
.on(engine);
132136

@@ -135,11 +139,13 @@ Meta.test(
135139

136140
await gql`
137141
query {
138-
test_wasi_ts(a: 15, b: 2)
142+
add(a: 11, b: 2)
143+
range(a: 1, b: 4)
139144
}
140145
`
141146
.expectData({
142-
test_wasi_ts: 17,
147+
add: 13,
148+
range: [1, 2, 3, 4],
143149
})
144150
.on(engine2);
145151

0 commit comments

Comments
 (0)