@@ -4,13 +4,14 @@ import { PolywrapClient } from "../../../PolywrapClient";
44import { mockPluginRegistration } from "../../helpers" ;
55import { ClientConfigBuilder } from "@polywrap/client-config-builder-js" ;
66import { Uri , UriMap } from "@polywrap/core-js" ;
7+ import { GetPathToTestWrappers } from "@polywrap/test-cases" ;
78
89jest . setTimeout ( 200000 ) ;
910
1011export const envTestCases = ( implementation : string ) => {
1112 describe ( "invoke with env" , ( ) => {
1213 test ( `invoke method without env does not require env in ${ implementation } ` , async ( ) => {
13- const wrapperPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/00-main/implementations/${ implementation } /build ` ;
14+ const wrapperPath = `${ GetPathToTestWrappers ( ) } / env-type/00-main/implementations/${ implementation } ` ;
1415 const wrapperUri = Uri . from ( `file/${ wrapperPath } ` ) ;
1516
1617 const builder = new ClientConfigBuilder ( ) ;
@@ -31,7 +32,7 @@ export const envTestCases = (implementation: string) => {
3132 } ) ;
3233
3334 test ( `invoke method without env works with env in ${ implementation } ` , async ( ) => {
34- const wrapperPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/00-main/implementations/${ implementation } /build ` ;
35+ const wrapperPath = `${ GetPathToTestWrappers ( ) } / env-type/00-main/implementations/${ implementation } ` ;
3536 const wrapperUri = Uri . from ( `file/${ wrapperPath } ` ) ;
3637
3738 const env = {
@@ -70,7 +71,7 @@ export const envTestCases = (implementation: string) => {
7071 } ) ;
7172
7273 test ( `invoke method with required env works with env in ${ implementation } ` , async ( ) => {
73- const wrapperPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/00-main/implementations/${ implementation } /build ` ;
74+ const wrapperPath = `${ GetPathToTestWrappers ( ) } / env-type/00-main/implementations/${ implementation } ` ;
7475 const wrapperUri = Uri . from ( `file/${ wrapperPath } ` ) ;
7576
7677 const env = {
@@ -123,7 +124,7 @@ export const envTestCases = (implementation: string) => {
123124 } ) ;
124125
125126 test ( `invoke method with required env throws without env registered in ${ implementation } ` , async ( ) => {
126- const wrapperPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/00-main/implementations/${ implementation } /build ` ;
127+ const wrapperPath = `${ GetPathToTestWrappers ( ) } / env-type/00-main/implementations/${ implementation } ` ;
127128 const wrapperUri = Uri . from ( `file/${ wrapperPath } ` ) ;
128129
129130 const builder = new ClientConfigBuilder ( ) ;
@@ -142,7 +143,7 @@ export const envTestCases = (implementation: string) => {
142143 } ) ;
143144
144145 test ( `invoke method with optional env works with env in ${ implementation } ` , async ( ) => {
145- const wrapperPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/00-main/implementations/${ implementation } /build ` ;
146+ const wrapperPath = `${ GetPathToTestWrappers ( ) } / env-type/00-main/implementations/${ implementation } ` ;
146147 const wrapperUri = Uri . from ( `file/${ wrapperPath } ` ) ;
147148
148149 const env = {
@@ -195,7 +196,7 @@ export const envTestCases = (implementation: string) => {
195196 } ) ;
196197
197198 test ( `invoke method with optional env works without env in ${ implementation } ` , async ( ) => {
198- const wrapperPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/00-main/implementations/${ implementation } /build ` ;
199+ const wrapperPath = `${ GetPathToTestWrappers ( ) } / env-type/00-main/implementations/${ implementation } ` ;
199200 const wrapperUri = Uri . from ( `file/${ wrapperPath } ` ) ;
200201
201202 const builder = new ClientConfigBuilder ( ) ;
@@ -214,7 +215,7 @@ export const envTestCases = (implementation: string) => {
214215 } ) ;
215216
216217 test ( `env can be registered for any uri in resolution path in ${ implementation } ` , async ( ) => {
217- const wrapperPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/00-main/implementations/${ implementation } /build ` ;
218+ const wrapperPath = `${ GetPathToTestWrappers ( ) } / env-type/00-main/implementations/${ implementation } ` ;
218219 const wrapperUri = Uri . from ( `file/${ wrapperPath } ` ) ;
219220 const redirectFromUri = Uri . from ( `mock/from` ) ;
220221
@@ -276,11 +277,8 @@ export const envTestCases = (implementation: string) => {
276277
277278 describe ( "subinvoke with env" , ( ) => {
278279 test ( `subinvoke method without env does not require env in ${ implementation } ` , async ( ) => {
279- // const subinvokerPath = `${GetPathToTestWrappers()}/env-type/01-subinvoker/implementations/${implementation}`;
280- // const subinvokedPath = `${GetPathToTestWrappers()}/env-type/00-main/implementations/${implementation}`;
281-
282- const subinvokerPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/env-type/01-subinvoker/implementations/${ implementation } /build` ;
283- const subinvokedPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/env-type/00-main/implementations/${ implementation } /build` ;
280+ const subinvokerPath = `${ GetPathToTestWrappers ( ) } /env-type/01-subinvoker/implementations/${ implementation } ` ;
281+ const subinvokedPath = `${ GetPathToTestWrappers ( ) } /env-type/00-main/implementations/${ implementation } ` ;
284282 const { uri : subinvokerUri } = Uri . from ( `file/${ subinvokerPath } ` ) ;
285283 const { uri : subinvokedUri } = Uri . from ( `file/${ subinvokedPath } ` ) ;
286284
@@ -303,8 +301,8 @@ export const envTestCases = (implementation: string) => {
303301 } ) ;
304302
305303 test ( `subinvoke method without env works with env in ${ implementation } ` , async ( ) => {
306- const subinvokerPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/01-subinvoker/implementations/${ implementation } /build ` ;
307- const subinvokedPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/00-main/implementations/${ implementation } /build ` ;
304+ const subinvokerPath = `${ GetPathToTestWrappers ( ) } / env-type/01-subinvoker/implementations/${ implementation } ` ;
305+ const subinvokedPath = `${ GetPathToTestWrappers ( ) } / env-type/00-main/implementations/${ implementation } ` ;
308306 const { uri : subinvokerUri } = Uri . from ( `file/${ subinvokerPath } ` ) ;
309307 const { uri : subinvokedUri } = Uri . from ( `file/${ subinvokedPath } ` ) ;
310308
@@ -344,8 +342,8 @@ export const envTestCases = (implementation: string) => {
344342 } ) ;
345343
346344 test ( `subinvoke method with required env works with env in ${ implementation } ` , async ( ) => {
347- const subinvokerPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/01-subinvoker/implementations/${ implementation } /build ` ;
348- const subinvokedPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/00-main/implementations/${ implementation } /build ` ;
345+ const subinvokerPath = `${ GetPathToTestWrappers ( ) } / env-type/01-subinvoker/implementations/${ implementation } ` ;
346+ const subinvokedPath = `${ GetPathToTestWrappers ( ) } / env-type/00-main/implementations/${ implementation } ` ;
349347 const { uri : subinvokerUri } = Uri . from ( `file/${ subinvokerPath } ` ) ;
350348 const { uri : subinvokedUri } = Uri . from ( `file/${ subinvokedPath } ` ) ;
351349
@@ -399,8 +397,8 @@ export const envTestCases = (implementation: string) => {
399397 } ) ;
400398
401399 test ( `subinvoke method with required env throws without env registered in ${ implementation } ` , async ( ) => {
402- const subinvokerPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/01-subinvoker/implementations/${ implementation } /build ` ;
403- const subinvokedPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/00-main/implementations/${ implementation } /build ` ;
400+ const subinvokerPath = `${ GetPathToTestWrappers ( ) } / env-type/01-subinvoker/implementations/${ implementation } ` ;
401+ const subinvokedPath = `${ GetPathToTestWrappers ( ) } / env-type/00-main/implementations/${ implementation } ` ;
404402 const { uri : subinvokerUri } = Uri . from ( `file/${ subinvokerPath } ` ) ;
405403 const { uri : subinvokedUri } = Uri . from ( `file/${ subinvokedPath } ` ) ;
406404
@@ -420,8 +418,8 @@ export const envTestCases = (implementation: string) => {
420418 } ) ;
421419
422420 test ( `subinvoke method with optional env works with env in ${ implementation } ` , async ( ) => {
423- const subinvokerPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/01-subinvoker/implementations/${ implementation } /build ` ;
424- const subinvokedPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/00-main/implementations/${ implementation } /build ` ;
421+ const subinvokerPath = `${ GetPathToTestWrappers ( ) } / env-type/01-subinvoker/implementations/${ implementation } ` ;
422+ const subinvokedPath = `${ GetPathToTestWrappers ( ) } / env-type/00-main/implementations/${ implementation } ` ;
425423 const { uri : subinvokerUri } = Uri . from ( `file/${ subinvokerPath } ` ) ;
426424 const { uri : subinvokedUri } = Uri . from ( `file/${ subinvokedPath } ` ) ;
427425
@@ -475,8 +473,8 @@ export const envTestCases = (implementation: string) => {
475473 } ) ;
476474
477475 test ( `subinvoke method with optional env works without env in ${ implementation } ` , async ( ) => {
478- const subinvokerPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/01-subinvoker/implementations/${ implementation } /build ` ;
479- const subinvokedPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/00-main/implementations/${ implementation } /build ` ;
476+ const subinvokerPath = `${ GetPathToTestWrappers ( ) } / env-type/01-subinvoker/implementations/${ implementation } ` ;
477+ const subinvokedPath = `${ GetPathToTestWrappers ( ) } / env-type/00-main/implementations/${ implementation } ` ;
480478 const { uri : subinvokerUri } = Uri . from ( `file/${ subinvokerPath } ` ) ;
481479 const { uri : subinvokedUri } = Uri . from ( `file/${ subinvokedPath } ` ) ;
482480
@@ -496,8 +494,8 @@ export const envTestCases = (implementation: string) => {
496494 } ) ;
497495
498496 test ( `subinvoker env does not override subinvoked env in ${ implementation } ` , async ( ) => {
499- const subinvokerPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/01 -subinvoker/implementations/${ implementation } /build ` ;
500- const subinvokedPath = `/home/nerfzael/dev/web3api/repos/wrap-test-harness/build/ env-type/00-main/implementations/${ implementation } /build ` ;
497+ const subinvokerPath = `${ GetPathToTestWrappers ( ) } / env-type/02 -subinvoker-with-env /implementations/${ implementation } ` ;
498+ const subinvokedPath = `${ GetPathToTestWrappers ( ) } / env-type/00-main/implementations/${ implementation } ` ;
501499 const { uri : subinvokerUri } = Uri . from ( `file/${ subinvokerPath } ` ) ;
502500 const { uri : subinvokedUri } = Uri . from ( `file/${ subinvokedPath } ` ) ;
503501
0 commit comments