MCPcopy Create free account
hub / github.com/nodejs/node / test_entries

Function test_entries

test/fixtures/wpt/common/performance-timeline-utils.js:36–49  ·  view source on GitHub ↗
(actualEntries, expectedEntries)

Source from the content-addressed store, hash-verified

34
35// assert for every entry in `expectedEntries`, there is a matching entry _somewhere_ in `actualEntries`
36function test_entries(actualEntries, expectedEntries) {
37 test_equals(actualEntries.length, expectedEntries.length)
38 expectedEntries.forEach(function (expectedEntry) {
39 var foundEntry = actualEntries.find(function (actualEntry) {
40 return typeof Object.keys(expectedEntry).find(function (key) {
41 return actualEntry[key] !== expectedEntry[key]
42 }) === 'undefined'
43 })
44 test_true(!!foundEntry, `Entry ${JSON.stringify(expectedEntry)} could not be found.`)
45 if (foundEntry) {
46 assert_object_equals(foundEntry.toJSON(), expectedEntry)
47 }
48 })
49}
50
51function delayedLoadListener(callback) {
52 window.addEventListener('load', function() {

Callers

nothing calls this directly

Calls 7

test_equalsFunction · 0.70
test_trueFunction · 0.70
forEachMethod · 0.65
findMethod · 0.65
keysMethod · 0.65
assert_object_equalsFunction · 0.50
toJSONMethod · 0.45

Tested by

no test coverage detected