Home / File/ fs-serve.spec.ts — vite Source File

fs-serve.spec.ts — vite Source File

Architecture documentation for fs-serve.spec.ts, a typescript file in the vite codebase. 8 imports, 0 dependents.

File typescript ViteCore ConfigEngine 8 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  c5d9d582_ebc8_2d5e_8baa_191bcc23239f["fs-serve.spec.ts"]
  f19ff479_9a29_9dfa_2aae_56203a34253f["safe.json"]
  c5d9d582_ebc8_2d5e_8baa_191bcc23239f --> f19ff479_9a29_9dfa_2aae_56203a34253f
  689e5a7c_b7c2_0909_a0c2_a9564d811346["node:net"]
  c5d9d582_ebc8_2d5e_8baa_191bcc23239f --> 689e5a7c_b7c2_0909_a0c2_a9564d811346
  51e96894_3556_ed5c_1ede_97d449867adf["node:path"]
  c5d9d582_ebc8_2d5e_8baa_191bcc23239f --> 51e96894_3556_ed5c_1ede_97d449867adf
  946bdba3_227b_3fc0_1b4c_ddbdb281f454["node:http"]
  c5d9d582_ebc8_2d5e_8baa_191bcc23239f --> 946bdba3_227b_3fc0_1b4c_ddbdb281f454
  a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"]
  c5d9d582_ebc8_2d5e_8baa_191bcc23239f --> a340ba46_b2b7_3048_3bb3_6907a74c8464
  daea26b3_da11_dee8_9ffd_9dbc0e857906["playwright-chromium"]
  c5d9d582_ebc8_2d5e_8baa_191bcc23239f --> daea26b3_da11_dee8_9ffd_9dbc0e857906
  c451f58f_4c4a_55a5_821f_db2d75f1115d["ws"]
  c5d9d582_ebc8_2d5e_8baa_191bcc23239f --> c451f58f_4c4a_55a5_821f_db2d75f1115d
  d3fd5575_295b_d6be_24dd_62d277645dc9["~utils"]
  c5d9d582_ebc8_2d5e_8baa_191bcc23239f --> d3fd5575_295b_d6be_24dd_62d277645dc9
  style c5d9d582_ebc8_2d5e_8baa_191bcc23239f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import net from 'node:net'
import path from 'node:path'
import http from 'node:http'
import {
  afterEach,
  beforeAll,
  beforeEach,
  describe,
  expect,
  test,
} from 'vitest'
import type { Page } from 'playwright-chromium'
import WebSocket from 'ws'
import testJSON from '../safe.json'
import {
  browser,
  isServe,
  isWindows,
  page,
  viteServer,
  viteTestUrl,
} from '~utils'

const getViteTestIndexHtmlUrl = () => {
  const srcPrefix = viteTestUrl.endsWith('/') ? '' : '/'
  // NOTE: viteTestUrl is set lazily
  return viteTestUrl + srcPrefix + 'src/'
}

const stringified = JSON.stringify(testJSON)

describe.runIf(isServe)('main', () => {
  beforeAll(async () => {
    await page.goto(getViteTestIndexHtmlUrl())
  })

  test('default import', async () => {
    await expect.poll(() => page.textContent('.full')).toBe(stringified)
  })

  test('named import', async () => {
    await expect.poll(() => page.textContent('.named')).toBe(testJSON.msg)
  })

  test('virtual svg module', async () => {
    await expect.poll(() => page.textContent('.virtual-svg')).toMatch('<svg')
  })

  test('safe fetch', async () => {
    await expect.poll(() => page.textContent('.safe-fetch')).toMatch('KEY=safe')
    await expect.poll(() => page.textContent('.safe-fetch-status')).toBe('200')
  })

  test('safe fetch with query', async () => {
    await expect
      .poll(() => page.textContent('.safe-fetch-query'))
      .toMatch('KEY=safe')
    await expect
      .poll(() => page.textContent('.safe-fetch-query-status'))
      .toBe('200')
// ... (601 more lines)

Domain

Subdomains

Dependencies

  • node:http
  • node:net
  • node:path
  • playwright-chromium
  • safe.json
  • vitest
  • ws
  • ~utils

Frequently Asked Questions

What does fs-serve.spec.ts do?
fs-serve.spec.ts is a source file in the vite codebase, written in typescript. It belongs to the ViteCore domain, ConfigEngine subdomain.
What functions are defined in fs-serve.spec.ts?
fs-serve.spec.ts defines 2 function(s): ArrayFromAsync, getViteTestIndexHtmlUrl.
What does fs-serve.spec.ts depend on?
fs-serve.spec.ts imports 8 module(s): node:http, node:net, node:path, playwright-chromium, safe.json, vitest, ws, ~utils.
Where is fs-serve.spec.ts in the architecture?
fs-serve.spec.ts is located at playground/fs-serve/__tests__/fs-serve.spec.ts (domain: ViteCore, subdomain: ConfigEngine, directory: playground/fs-serve/__tests__).

Analyze Your Own Codebase

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

Try Supermodel Free