Home / File/ ssr-wasm.spec.ts — vite Source File

ssr-wasm.spec.ts — vite Source File

Architecture documentation for ssr-wasm.spec.ts, a typescript file in the vite codebase. 3 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  19950c0c_258c_2a21_dfd9_9d53e842218e["ssr-wasm.spec.ts"]
  c0d25153_093b_2174_5b61_48846e1615ea["serve.ts"]
  19950c0c_258c_2a21_dfd9_9d53e842218e --> c0d25153_093b_2174_5b61_48846e1615ea
  a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"]
  19950c0c_258c_2a21_dfd9_9d53e842218e --> a340ba46_b2b7_3048_3bb3_6907a74c8464
  d3fd5575_295b_d6be_24dd_62d277645dc9["~utils"]
  19950c0c_258c_2a21_dfd9_9d53e842218e --> d3fd5575_295b_d6be_24dd_62d277645dc9
  style 19950c0c_258c_2a21_dfd9_9d53e842218e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { expect, test } from 'vitest'
import { port } from './serve'
import { findAssetFile, isBuild, listAssets, page } from '~utils'

const url = `http://localhost:${port}`

test('should work when inlined', async () => {
  await page.goto(`${url}/static-light`)
  expect(await page.textContent('.static-light')).toMatch('42')
})

test('should work when output', async () => {
  await page.goto(`${url}/static-heavy`)
  expect(await page.textContent('.static-heavy')).toMatch('24')
})

test.runIf(isBuild)('should not contain wasm file when inlined', async () => {
  const assets = await listAssets()
  const lightWasm = assets.find((f) => /light-.+\.wasm$/.test(f))
  expect(lightWasm).toBeUndefined()

  const staticLight = await findAssetFile(/^static-light-.+\.js$/)
  expect(staticLight).toContain('data:application/wasm;base64,')
})

test.runIf(isBuild)(
  'should contain and reference wasm file when output',
  async () => {
    const assets = await listAssets()
    const heavyWasm = assets.find((f) => /heavy-.+\.wasm$/.test(f))
    expect(heavyWasm).toBeDefined()

    const staticHeavy = await findAssetFile(/^static-heavy-.+\.js$/)
    expect(staticHeavy).toContain(heavyWasm)
    expect(staticHeavy).not.toContain('data:application/wasm;base64,')
  },
)

Domain

Dependencies

Frequently Asked Questions

What does ssr-wasm.spec.ts do?
ssr-wasm.spec.ts is a source file in the vite codebase, written in typescript. It belongs to the ViteCore domain.
What does ssr-wasm.spec.ts depend on?
ssr-wasm.spec.ts imports 3 module(s): serve.ts, vitest, ~utils.
Where is ssr-wasm.spec.ts in the architecture?
ssr-wasm.spec.ts is located at playground/ssr-wasm/__tests__/ssr-wasm.spec.ts (domain: ViteCore, directory: playground/ssr-wasm/__tests__).

Analyze Your Own Codebase

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

Try Supermodel Free