From 2ebf46e6ca7f75f2292d755513b41edd4d565a88 Mon Sep 17 00:00:00 2001 From: engin0223 Date: Fri, 5 Jun 2026 14:25:33 +0300 Subject: [PATCH] fix: add eslint-disable comments in Thrift tests --- src/core/operations/ThriftSerialize.mjs | 2 +- tests/node/tests/lib/Thrift.mjs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/operations/ThriftSerialize.mjs b/src/core/operations/ThriftSerialize.mjs index c744306a..b7c06fe5 100644 --- a/src/core/operations/ThriftSerialize.mjs +++ b/src/core/operations/ThriftSerialize.mjs @@ -6,7 +6,7 @@ */ import Operation from "../Operation.mjs"; -import { +import { buildBinaryStruct } from "../lib/Thrift.mjs"; diff --git a/tests/node/tests/lib/Thrift.mjs b/tests/node/tests/lib/Thrift.mjs index 7a975c86..7c153347 100644 --- a/tests/node/tests/lib/Thrift.mjs +++ b/tests/node/tests/lib/Thrift.mjs @@ -336,9 +336,11 @@ TestRegister.addApiTests([ // ===== buildBinaryStruct tests ===== it("Thrift: buildBinaryStruct - simple struct", () => { const bytes = []; + // eslint-disable camelcase const jsonStruct = { field_1: { type: "I32", value: 42 } }; + // eslint-enable camelcase buildBinaryStruct(jsonStruct, bytes); const expected = [ 8, 0, 1, // field type (I32), field id = 1 @@ -350,10 +352,12 @@ TestRegister.addApiTests([ it("Thrift: buildBinaryStruct - multiple fields", () => { const bytes = []; + // eslint-disable camelcase const jsonStruct = { field_1: { type: "I32", value: 42 }, field_2: { type: "BINARY", value: "hello" } }; + // eslint-enable camelcase buildBinaryStruct(jsonStruct, bytes); // Should end with T_STOP assert.strictEqual(bytes[bytes.length - 1], 0); @@ -361,9 +365,11 @@ TestRegister.addApiTests([ it("Thrift: buildBinaryStruct - BOOL field", () => { const bytes = []; + // eslint-disable camelcase const jsonStruct = { field_1: { type: "BOOL", value: true } }; + // eslint-enable camelcase buildBinaryStruct(jsonStruct, bytes); const expected = [ 2, 0, 1, // field type (BOOL), field id = 1 @@ -375,6 +381,7 @@ TestRegister.addApiTests([ it("Thrift: buildBinaryStruct - nested struct", () => { const bytes = []; + // eslint-disable camelcase const jsonStruct = { field_1: { type: "STRUCT", @@ -383,6 +390,7 @@ TestRegister.addApiTests([ } } }; + // eslint-enable camelcase buildBinaryStruct(jsonStruct, bytes); // Should contain nested structure with T_STOP markers assert.ok(bytes.length > 0); @@ -391,10 +399,12 @@ TestRegister.addApiTests([ it("Thrift: buildBinaryStruct - invalid field ID skipped", () => { const bytes = []; + // eslint-disable camelcase const jsonStruct = { invalid_field: { type: "I32", value: 42 }, field_1: { type: "I32", value: 10 } }; + // eslint-enable camelcase buildBinaryStruct(jsonStruct, bytes); // Should skip invalid_field and only process field_1 assert.strictEqual(bytes[0], 8); // field type