diff --git a/.changeset/perfect-balloons-obey.md b/.changeset/perfect-balloons-obey.md new file mode 100644 index 000000000..24a312f66 --- /dev/null +++ b/.changeset/perfect-balloons-obey.md @@ -0,0 +1,5 @@ +--- +"@azure-tools/cadl-ranch-specs": patch +--- + +fix(test): adopt `coercedBodyEquals` diff --git a/packages/cadl-ranch-specs/http/type/property/nullable/mockapi.ts b/packages/cadl-ranch-specs/http/type/property/nullable/mockapi.ts index cc3377484..05416698b 100644 --- a/packages/cadl-ranch-specs/http/type/property/nullable/mockapi.ts +++ b/packages/cadl-ranch-specs/http/type/property/nullable/mockapi.ts @@ -36,7 +36,7 @@ function createServerTests(url: string, value: unknown, patchNullableProperty?: status: 204, }, handler: (req: MockRequest) => { - req.expect.bodyEquals({ + req.expect.coercedBodyEquals({ requiredProperty: "foo", nullableProperty: patchNullableProperty || null, }); diff --git a/packages/cadl-ranch-specs/http/type/property/optionality/mockapi.ts b/packages/cadl-ranch-specs/http/type/property/optionality/mockapi.ts index ba4b77390..fe4b39285 100644 --- a/packages/cadl-ranch-specs/http/type/property/optionality/mockapi.ts +++ b/packages/cadl-ranch-specs/http/type/property/optionality/mockapi.ts @@ -30,7 +30,7 @@ function createServerTests(url: string, value: unknown) { status: 204, }, handler: (req: MockRequest) => { - req.expect.bodyEquals(value); + req.expect.coercedBodyEquals(value); return { status: 204, };