Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/core/operations/AvroToJSON.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/operations/Bzip2Compress.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
12 changes: 12 additions & 0 deletions tests/node/tests/operations.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: ":",
Expand Down
Loading