Skip to content

Commit b821c0f

Browse files
committed
Fix array contains needing exact matches for spans in transaction matching
1 parent 8ae755c commit b821c0f

File tree

1 file changed

+4
-1
lines changed
  • packages/nextjs/test/integration/test/utils

1 file changed

+4
-1
lines changed

packages/nextjs/test/integration/test/utils/client.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { strictEqual } = require('assert');
2+
const expect = require('expect');
23
const { logIf, parseEnvelope } = require('./common');
34

45
const VALID_REQUEST_PAYLOAD = {
@@ -105,8 +106,10 @@ const assertObjectMatches = (actual, expected) => {
105106
for (const key in expected) {
106107
const expectedValue = expected[key];
107108

108-
if (Object.prototype.toString.call(expectedValue) === '[object Object]' || Array.isArray(expectedValue)) {
109+
if (Object.prototype.toString.call(expectedValue) === '[object Object]') {
109110
assertObjectMatches(actual[key], expectedValue);
111+
} else if (Array.isArray(expectedValue)) {
112+
expect(actual[key]).toEqual(expect.arrayContaining(expectedValue.map(expect.objectContaining)));
110113
} else {
111114
strictEqual(actual[key], expectedValue);
112115
}

0 commit comments

Comments
 (0)