Files
libp2p-test-plans/transport-interop/impl/js/v1.x/test/fixtures/redis-proxy.ts
Alex Potsides fb99e690a6 fix: add js tests to this repo (#365)
Trying to debug these tests in CI is incredibly difficult and since they depend on older versions of previously published modules, if something breaks due to a bug in released code it's very hard to fix it.

Instead follow the pattern in the perf tests and include the full test implementations here.
2024-06-06 10:53:35 +01:00

13 lines
296 B
TypeScript

export async function redisProxy (commands: any[]): Promise<any> {
const res = await fetch(`http://localhost:${process.env.REDIS_PROXY_PORT}`, {
method: 'POST',
body: JSON.stringify(commands)
})
if (!res.ok) {
throw new Error('Redis command failed')
}
return res.json()
}