Skip to content

Commit 456c392

Browse files
committed
Use nullish chaining in integration test
1 parent 1bafbdd commit 456c392

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

js/bin/integration.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const exists = async (p) => {
6363
}
6464
})()
6565
.then((x) => +x || 0, (e) => {
66-
e && process.stderr.write(`${e && e.stack || e}\n`);
66+
e && process.stderr.write(`${e?.stack || e}\n`);
6767
return process.exitCode || 1;
6868
}).then((code) => process.exit(code));
6969

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

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

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

0 commit comments

Comments
 (0)