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

Function test_operations

test/fixtures/wpt/wasm/jsapi/interface.any.js:4–23  ·  view source on GitHub ↗
(object, object_name, operations)

Source from the content-addressed store, hash-verified

2// META: script=/wasm/jsapi/assertions.js
3
4function test_operations(object, object_name, operations) {
5 for (const [name, length] of operations) {
6 test(() => {
7 const propdesc = Object.getOwnPropertyDescriptor(object, name);
8 assert_equals(typeof propdesc, "object");
9 assert_true(propdesc.writable, "writable");
10 assert_true(propdesc.enumerable, "enumerable");
11 assert_true(propdesc.configurable, "configurable");
12 assert_equals(propdesc.value, object[name]);
13 }, `${object_name}.${name}`);
14
15 test(() => {
16 assert_function_name(object[name], name, `${object_name}.${name}`);
17 }, `${object_name}.${name}: name`);
18
19 test(() => {
20 assert_function_length(object[name], length, `${object_name}.${name}`);
21 }, `${object_name}.${name}: length`);
22 }
23}
24
25function test_attributes(object, object_name, attributes) {
26 for (const [name, mutable] of attributes) {

Callers 1

interface.any.jsFile · 0.85

Calls 5

assert_function_nameFunction · 0.85
assert_function_lengthFunction · 0.85
testFunction · 0.50
assert_equalsFunction · 0.50
assert_trueFunction · 0.50

Tested by

no test coverage detected