4
4
import { BasicAuth , tgDeploy , tgRemove } from "@typegraph/sdk/tg_deploy.js" ;
5
5
import { gql , Meta } from "test-utils/mod.ts" ;
6
6
import { testDir } from "test-utils/dir.ts" ;
7
- import { tg } from "./wasmedge .ts" ;
7
+ import { tg } from "./wasm .ts" ;
8
8
import * as path from "std/path/mod.ts" ;
9
9
import { connect } from "redis" ;
10
10
import { S3Client } from "aws-sdk/client-s3" ;
@@ -45,12 +45,12 @@ const syncConfig = {
45
45
s3Bucket : "metatype-sync-test" ,
46
46
} ;
47
47
48
- const cwd = path . join ( testDir , "runtimes/wasmedge " ) ;
48
+ const cwd = path . join ( testDir , "runtimes/wasm " ) ;
49
49
const auth = new BasicAuth ( "admin" , "password" ) ;
50
50
51
51
Meta . test (
52
52
{
53
- name : "WasmEdge Runtime typescript SDK: Sync Config" ,
53
+ name : "Wasm Runtime typescript SDK: Sync Config" ,
54
54
port : true ,
55
55
systemTypegraphs : true ,
56
56
syncConfig,
@@ -78,7 +78,7 @@ Meta.test(
78
78
} ,
79
79
dir : cwd ,
80
80
} ,
81
- typegraphPath : path . join ( cwd , "wasmedge .ts" ) ,
81
+ typegraphPath : path . join ( cwd , "wasm .ts" ) ,
82
82
secrets : { } ,
83
83
} ) ;
84
84
@@ -89,7 +89,7 @@ Meta.test(
89
89
assertExists ( serialized , "serialized has a value" ) ;
90
90
assertEquals ( gateResponseAdd , {
91
91
data : {
92
- addTypegraph : { name : "wasmedge_ts " , messages : [ ] , migrations : [ ] } ,
92
+ addTypegraph : { name : "wasm-ts " , messages : [ ] , migrations : [ ] } ,
93
93
} ,
94
94
} ) ;
95
95
@@ -100,12 +100,14 @@ Meta.test(
100
100
const engine = await metaTest . engineFromDeployed ( serialized ) ;
101
101
102
102
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
+ `
107
108
. expectData ( {
108
- test_wasi_ts : 13 ,
109
+ add : 13 ,
110
+ range : [ 1 , 2 , 3 , 4 ] ,
109
111
} )
110
112
. on ( engine ) ;
111
113
@@ -121,12 +123,14 @@ Meta.test(
121
123
const engine = await metaTest . engineFromDeployed ( serialized ) ;
122
124
123
125
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
+ `
128
131
. expectData ( {
129
- test_wasi_ts : 23 ,
132
+ add : 13 ,
133
+ range : [ 1 , 2 , 3 , 4 ] ,
130
134
} )
131
135
. on ( engine ) ;
132
136
@@ -135,11 +139,13 @@ Meta.test(
135
139
136
140
await gql `
137
141
query {
138
- test_wasi_ts(a: 15, b: 2)
142
+ add(a: 11, b: 2)
143
+ range(a: 1, b: 4)
139
144
}
140
145
`
141
146
. expectData ( {
142
- test_wasi_ts : 17 ,
147
+ add : 13 ,
148
+ range : [ 1 , 2 , 3 , 4 ] ,
143
149
} )
144
150
. on ( engine2 ) ;
145
151
0 commit comments