Skip to content

Commit 83e35fc

Browse files
committed
Make stress test not care about label and property ordering
1 parent 7958522 commit 83e35fc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/v1/stress.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,12 @@ describe('stress tests', () => {
217217
function verifyRecord(record) {
218218
const node = record.get(0);
219219

220-
if (!_.isEqual(['Person', 'Employee'], node.labels)) {
220+
if (!arraysEqual(['Person', 'Employee'], node.labels)) {
221221
return new Error(`Unexpected labels in node: ${JSON.stringify(node)}`);
222222
}
223223

224224
const propertyKeys = _.keys(node.properties);
225-
if (!_.isEmpty(propertyKeys) && !_.isEqual(['name', 'salary'], propertyKeys)) {
225+
if (!_.isEmpty(propertyKeys) && !arraysEqual(['name', 'salary'], propertyKeys)) {
226226
return new Error(`Unexpected property keys in node: ${JSON.stringify(node)}`);
227227
}
228228

@@ -298,6 +298,10 @@ describe('stress tests', () => {
298298
});
299299
}
300300

301+
function arraysEqual(array1, array2) {
302+
return _.difference(array1, array2).length === 0;
303+
}
304+
301305
class Context {
302306

303307
constructor(driver, loggingEnabled) {

0 commit comments

Comments
 (0)