Home / Function/ test() — react Function Reference

test() — react Function Reference

Architecture documentation for the test() function in hookSerializer.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  df4ce13f_be28_d782_4619_765d45715626["test()"]
  e2252a4e_d1c2_c24c_476b_66f81e018367["hookSerializer.js"]
  df4ce13f_be28_d782_4619_765d45715626 -->|defined in| e2252a4e_d1c2_c24c_476b_66f81e018367
  bc4ee0cf_11fd_001d_c4c2_63f7e1f89267["hasAbsoluteFileName()"]
  df4ce13f_be28_d782_4619_765d45715626 -->|calls| bc4ee0cf_11fd_001d_c4c2_63f7e1f89267
  style df4ce13f_be28_d782_4619_765d45715626 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/__tests__/__serializers__/hookSerializer.js lines 38–54

export function test(maybeHook) {
  if (maybeHook === null || typeof maybeHook !== 'object') {
    return false;
  }

  const hasOwnProperty = Object.prototype.hasOwnProperty.bind(maybeHook);

  return (
    hasOwnProperty('id') &&
    hasOwnProperty('isStateEditable') &&
    hasOwnProperty('name') &&
    hasOwnProperty('subHooks') &&
    hasOwnProperty('value') &&
    // Don't re-process an already printed hook.
    hasAbsoluteFileName(maybeHook)
  );
}

Domain

Subdomains

Frequently Asked Questions

What does test() do?
test() is a function in the react codebase, defined in packages/react-devtools-shared/src/__tests__/__serializers__/hookSerializer.js.
Where is test() defined?
test() is defined in packages/react-devtools-shared/src/__tests__/__serializers__/hookSerializer.js at line 38.
What does test() call?
test() calls 1 function(s): hasAbsoluteFileName.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free