diff --git a/src/core/operations/AvroToJSON.mjs b/src/core/operations/AvroToJSON.mjs index 497a3872b7..585bd872a3 100644 --- a/src/core/operations/AvroToJSON.mjs +++ b/src/core/operations/AvroToJSON.mjs @@ -39,7 +39,7 @@ class AvroToJSON extends Operation { * @param {Object[]} args * @returns {string} */ - run(input, args) { + async run(input, args) { if (input.byteLength <= 0) { throw new OperationError("Please provide an input."); } diff --git a/src/core/operations/Bzip2Compress.mjs b/src/core/operations/Bzip2Compress.mjs index 45dbfae64e..b5105e9813 100644 --- a/src/core/operations/Bzip2Compress.mjs +++ b/src/core/operations/Bzip2Compress.mjs @@ -47,7 +47,7 @@ class Bzip2Compress extends Operation { * @param {Object[]} args * @returns {File} */ - run(input, args) { + async run(input, args) { const [blockSize, workFactor] = args; if (input.byteLength <= 0) { throw new OperationError("Please provide an input."); diff --git a/tests/node/tests/operations.mjs b/tests/node/tests/operations.mjs index 0046574c8f..c6f0e44fa0 100644 --- a/tests/node/tests/operations.mjs +++ b/tests/node/tests/operations.mjs @@ -264,6 +264,18 @@ Full hash: $2a$10$ODeP1.6fMsb.ENk2ngPUCO7qTGVPyHA9TqDVcyupyed8FjsiF65L6`; assert.strictEqual(result.toString(), "Fit as a Fiddle"); }), + it("Bzip2 Compress: round-trips through the Node API", async () => { + const compressed = await chef.bzip2Compress("The quick brown fox."); + const result = await chef.bzip2Decompress(compressed); + assert.strictEqual(result.toString(), "The quick brown fox."); + }), + + it("Avro to JSON: decodes an object container file through the Node API", async () => { + const avro = chef.fromHex("4f626a0104166176726f2e736368656d6196017b2274797065223a227265636f7264222c226e616d65223a22736d616c6c222c226669656c6473223a5b7b226e616d65223a226e616d65222c2274797065223a22737472696e67227d5d7d146176726f2e636f646563086e756c6c004e0247632e3702e5b75cdab9a62f1541020e0c6d796e616d654e0247632e3702e5b75cdab9a62f1541"); + const result = await chef.avroToJSON(avro); + assert.strictEqual(result.toString(), "{\n \"name\": \"myname\"\n}"); + }), + it("cartesianProduct: binary string", () => { const result = cartesianProduct("1:2\\n\\n3:4", { itemDelimiter: ":",