Home / Function/ toEl() — vite Function Reference

toEl() — vite Function Reference

Architecture documentation for the toEl() function in test-utils.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  7dacb29d_bf7e_9683_9334_81d5496b7829["toEl()"]
  c68b21f4_9cd3_3abe_8169_0de2c9650f53["test-utils.ts"]
  7dacb29d_bf7e_9683_9334_81d5496b7829 -->|defined in| c68b21f4_9cd3_3abe_8169_0de2c9650f53
  c457009e_7b0c_b0bd_c1c7_887968a0e3e2["getColor()"]
  c457009e_7b0c_b0bd_c1c7_887968a0e3e2 -->|calls| 7dacb29d_bf7e_9683_9334_81d5496b7829
  646c1759_79d9_a24d_728a_0d324747ead3["getBg()"]
  646c1759_79d9_a24d_728a_0d324747ead3 -->|calls| 7dacb29d_bf7e_9683_9334_81d5496b7829
  be8a3ff3_0b5f_03cb_da16_42517372d5e5["getBgColor()"]
  be8a3ff3_0b5f_03cb_da16_42517372d5e5 -->|calls| 7dacb29d_bf7e_9683_9334_81d5496b7829
  style 7dacb29d_bf7e_9683_9334_81d5496b7829 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

playground/test-utils.ts lines 93–107

async function toEl(
  el: string | ElementHandle | Locator,
): Promise<ElementHandle> {
  if (typeof el === 'string') {
    const realEl = await page.$(el)
    if (realEl == null) {
      throw new Error(`Cannot find element: "${el}"`)
    }
    return realEl
  }
  if ('elementHandle' in el) {
    return el.elementHandle()
  }
  return el
}

Domain

Subdomains

Frequently Asked Questions

What does toEl() do?
toEl() is a function in the vite codebase, defined in playground/test-utils.ts.
Where is toEl() defined?
toEl() is defined in playground/test-utils.ts at line 93.
What calls toEl()?
toEl() is called by 3 function(s): getBg, getBgColor, getColor.

Analyze Your Own Codebase

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

Try Supermodel Free