Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
const plugin = require(".");

describe("JSON-To-XML plugin", () => {
/** @type {Fastify.FastifyInstance} */

Check warning on line 9 in src/index.test.js

View workflow job for this annotation

GitHub Actions / Lint Code

The type 'Fastify.FastifyInstance' is undefined
let server;

const resBody = {
Expand Down Expand Up @@ -69,9 +69,10 @@
},
},
];
const jsonTestsLength = jsonTests.length;

for (const { testName, headers } of jsonTests) {
// eslint-disable-next-line no-loop-func -- false positive, server use is safe
for (let i = 0; i < jsonTestsLength; i += 1) {
const { testName, headers } = jsonTests[i];
it(`Returns ${testName}`, async (t) => {
const response = await server.inject({
method: "GET",
Expand Down Expand Up @@ -107,9 +108,10 @@
},
},
];
const xmlTestsLength = xmlTests.length;

for (const { testName, headers } of xmlTests) {
// eslint-disable-next-line no-loop-func -- false positive, server use is safe
for (let i = 0; i < xmlTestsLength; i += 1) {
const { testName, headers } = xmlTests[i];
describe(testName, () => {
it("Returns HTTP status code 500 due to invalid XML characters", async (t) => {
const response = await server.inject({
Expand Down