how to return xml using ctx in expressJS

67 Views Asked by At

How can i return xml using ctx from msw package?

now i using this code:

const endpointHandler = (req, res, ctx) => {
  const xml = `<test></test>`;

  return res(ctx.status(200), ctx.xml(xml));
};

but it's don't work

any help?

1

There are 1 best solutions below

0
yanir midler On

ok i get it :

return res(ctx.xml(<test></test>));