OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 Distributed under both the W3C Test Suite License [1] and the W3C | |
3 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the | |
4 policies and contribution forms [3]. | |
5 | |
6 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license | |
7 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license | |
8 [3] http://www.w3.org/2004/10/27-testcases | |
9 */ | |
10 | |
11 // assert for every entry in `expectedEntries`, there is a matching entry _somew here_ in `actualEntries` | |
12 function test_entries(actualEntries, expectedEntries) { | |
panicker
2017/04/14 19:31:04
why not move this to the common util?
(There is no
| |
13 test_equals(actualEntries.length, expectedEntries.length) | |
14 expectedEntries.forEach(function (expectedEntry) { | |
15 test_true(!!actualEntries.find(function (actualEntry) { | |
16 return typeof Object.keys(expectedEntry).find(function (key) { | |
17 return actualEntry[key] !== expectedEntry[key] | |
18 }) === 'undefined' | |
19 })) | |
20 }) | |
21 } | |
OLD | NEW |