зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1470688 [wpt PR 11642] - [testharness.js][docs] Improve and document assert_object_equals, a=testonly
Automatic update from web-platform-tests[testharness.js][docs] Improve and document assert_object_equals (#11642) Fixes #10262. -- wpt-commits: 5efecac39e051e64c0f4aa72f866f105e226f1a5 wpt-pr: 11642
This commit is contained in:
Родитель
1ce7e16c82
Коммит
b93ace3ff6
|
@ -565090,7 +565090,7 @@
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"docs/_writing-tests/testharness-api.md": [
|
"docs/_writing-tests/testharness-api.md": [
|
||||||
"ccad9b2b76eb48205d1f30847e0472e565d22156",
|
"a4109b95dfdd98b9f83d15dce8c47867fd0f37ff",
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"docs/_writing-tests/testharness.md": [
|
"docs/_writing-tests/testharness.md": [
|
||||||
|
|
|
@ -700,6 +700,11 @@ Relies on `===`, distinguishes between `-0` and `+0`, and has a specific check f
|
||||||
asserts that `expected` is an Array, and `actual` is equal to one of the
|
asserts that `expected` is an Array, and `actual` is equal to one of the
|
||||||
members i.e. `expected.indexOf(actual) != -1`
|
members i.e. `expected.indexOf(actual) != -1`
|
||||||
|
|
||||||
|
### `assert_object_equals(actual, expected, description)`
|
||||||
|
asserts that `actual` is an object and not null and that all enumerable
|
||||||
|
properties on `actual` are own properties on `expected` with the same values,
|
||||||
|
recursing if the value is an object and not null.
|
||||||
|
|
||||||
### `assert_array_equals(actual, expected, description)`
|
### `assert_array_equals(actual, expected, description)`
|
||||||
asserts that `actual` and `expected` have the same
|
asserts that `actual` and `expected` have the same
|
||||||
length and the value of each indexed property in `actual` is the strictly equal
|
length and the value of each indexed property in `actual` is the strictly equal
|
||||||
|
|
|
@ -997,6 +997,9 @@ policies and contribution forms [3].
|
||||||
|
|
||||||
function assert_object_equals(actual, expected, description)
|
function assert_object_equals(actual, expected, description)
|
||||||
{
|
{
|
||||||
|
assert(typeof actual === "object" && actual !== null, "assert_object_equals", description,
|
||||||
|
"value is ${actual}, expected object",
|
||||||
|
{actual: actual});
|
||||||
//This needs to be improved a great deal
|
//This needs to be improved a great deal
|
||||||
function check_equal(actual, expected, stack)
|
function check_equal(actual, expected, stack)
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче