refactor: migrate legacy wire namespace to wrn
This commit is contained in:
@@ -30,7 +30,7 @@ const billing = defineService({
|
||||
},
|
||||
});
|
||||
|
||||
function wire(allowed: boolean) {
|
||||
function wrn(allowed: boolean) {
|
||||
const service = implement(
|
||||
billing,
|
||||
{
|
||||
@@ -47,7 +47,7 @@ function wire(allowed: boolean) {
|
||||
});
|
||||
}
|
||||
|
||||
function httpWire(allowed: boolean) {
|
||||
function createHttpTransport(allowed: boolean) {
|
||||
const service = implement(
|
||||
billing,
|
||||
{
|
||||
@@ -122,7 +122,7 @@ describe("RPC integration", () => {
|
||||
const client = serviceClient(billing, {
|
||||
app: "billing",
|
||||
as: { user: { id: "u1" }, tenant: { id: "acme" }, locals: {} } as unknown as Context,
|
||||
transport: wire(true),
|
||||
transport: wrn(true),
|
||||
});
|
||||
expect(await client.createInvoice({ amountCents: 250 })).toEqual({
|
||||
invoiceId: "inv_250",
|
||||
@@ -136,7 +136,7 @@ describe("RPC integration", () => {
|
||||
const client = serviceClient(billing, {
|
||||
app: "billing",
|
||||
as: { user: { id: "u1" }, locals: {} } as unknown as Context,
|
||||
transport: wire(false),
|
||||
transport: wrn(false),
|
||||
});
|
||||
await expect(client.createInvoice({ amountCents: 1 })).rejects.toMatchObject({
|
||||
code: RPC_ERROR_CODES.denied,
|
||||
@@ -149,7 +149,7 @@ describe("RPC integration", () => {
|
||||
const client = serviceClient(billing, {
|
||||
app: "billing",
|
||||
as: { user: { id: "u1" }, locals: {} } as unknown as Context,
|
||||
transport: httpWire(true),
|
||||
transport: createHttpTransport(true),
|
||||
});
|
||||
expect(await client.createInvoice({ amountCents: 7 })).toEqual({
|
||||
invoiceId: "inv_7",
|
||||
|
||||
Reference in New Issue
Block a user