Skip to content

Commit

Permalink
Use nullish chaining in integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed May 8, 2021
1 parent 1bafbdd commit 456c392
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/bin/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const exists = async (p) => {
}
})()
.then((x) => +x || 0, (e) => {
e && process.stderr.write(`${e && e.stack || e}\n`);
e && process.stderr.write(`${e?.stack || e}\n`);
return process.exitCode || 1;
}).then((code) => process.exit(code));

Expand Down Expand Up @@ -141,7 +141,7 @@ function validateReaderIntegration(jsonData, arrowBuffer) {
for (const [jsonRecordBatch, binaryRecordBatch] of zip(jsonReader, binaryReader)) {
compareTableIsh(jsonRecordBatch, binaryRecordBatch);
}
} catch (e) { throw new Error(`${msg}: fail \n ${e && e.stack || e}`); }
} catch (e) { throw new Error(`${msg}: fail \n ${e?.stack || e}`); }
process.stdout.write(`${msg}: pass\n`);
}

Expand All @@ -151,7 +151,7 @@ function validateTableFromBuffersIntegration(jsonData, arrowBuffer) {
const jsonTable = Table.from(jsonData);
const binaryTable = Table.from(arrowBuffer);
compareTableIsh(jsonTable, binaryTable);
} catch (e) { throw new Error(`${msg}: fail \n ${e && e.stack || e}`); }
} catch (e) { throw new Error(`${msg}: fail \n ${e?.stack || e}`); }
process.stdout.write(`${msg}: pass\n`);
}

Expand All @@ -164,7 +164,7 @@ function validateTableToBuffersIntegration(srcFormat, arrowFormat) {
const srcTable = Table.from(srcFormat === `json` ? jsonData : arrowBuffer);
const dstTable = Table.from(srcTable.serialize(`binary`, arrowFormat === `stream`));
compareTableIsh(dstTable, refTable);
} catch (e) { throw new Error(`${msg}: fail \n ${e && e.stack || e}`); }
} catch (e) { throw new Error(`${msg}: fail \n ${e?.stack || e}`); }
process.stdout.write(`${msg}: pass\n`);
};
}
Expand Down

0 comments on commit 456c392

Please sign in to comment.