Home / File/ worker-es.spec.ts — vite Source File

worker-es.spec.ts — vite Source File

Architecture documentation for worker-es.spec.ts, a typescript file in the vite codebase. 4 imports, 0 dependents.

File typescript 4 imports

Entity Profile

Dependency Diagram

graph LR
  461e4e9c_6409_ceb5_2913_fc14a77703e2["worker-es.spec.ts"]
  e6032fbc_44cf_58d6_868d_dd15106c18c5["node:fs"]
  461e4e9c_6409_ceb5_2913_fc14a77703e2 --> e6032fbc_44cf_58d6_868d_dd15106c18c5
  51e96894_3556_ed5c_1ede_97d449867adf["node:path"]
  461e4e9c_6409_ceb5_2913_fc14a77703e2 --> 51e96894_3556_ed5c_1ede_97d449867adf
  a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"]
  461e4e9c_6409_ceb5_2913_fc14a77703e2 --> a340ba46_b2b7_3048_3bb3_6907a74c8464
  d3fd5575_295b_d6be_24dd_62d277645dc9["~utils"]
  461e4e9c_6409_ceb5_2913_fc14a77703e2 --> d3fd5575_295b_d6be_24dd_62d277645dc9
  style 461e4e9c_6409_ceb5_2913_fc14a77703e2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import fs from 'node:fs'
import path from 'node:path'
import { describe, expect, test } from 'vitest'
import { isBuild, page, testDir } from '~utils'

test('normal', async () => {
  await expect.poll(() => page.textContent('.pong')).toMatch('pong')
  await expect
    .poll(() => page.textContent('.mode'))
    .toMatch(process.env.NODE_ENV)
  await expect
    .poll(() => page.textContent('.bundle-with-plugin'))
    .toMatch('worker bundle with plugin success!')
  await expect
    .poll(() => page.textContent('.asset-url'))
    .toMatch(
      isBuild
        ? /\/es\/assets\/worker_asset-vite-[\w-]{8}\.svg/
        : '/es/vite.svg',
    )
  await expect.poll(() => page.textContent('.dep-cjs')).toMatch('[cjs ok]')
})

test('named', async () => {
  await expect
    .poll(() => page.textContent('.pong-named'))
    .toMatch('namedWorker')
})

test('TS output', async () => {
  await expect.poll(() => page.textContent('.pong-ts-output')).toMatch('pong')
})

test('inlined', async () => {
  await expect.poll(() => page.textContent('.pong-inline')).toMatch('pong')
})

test('named inlined', async () => {
  await expect
    .poll(() => page.textContent('.pong-inline-named'))
    .toMatch('namedInlineWorker')
})

test('import meta url', async () => {
  await expect
    .poll(() => page.textContent('.pong-inline-url'))
    .toMatch(/^(blob|http):/)
})

test('unicode inlined', async () => {
  await expect
    .poll(() => page.textContent('.pong-inline-unicode'))
    .toMatch('•pong•')
})

test('shared worker', async () => {
  await expect.poll(() => page.textContent('.tick-count')).toMatch('pong')
})

test('named shared worker', async () => {
// ... (145 more lines)

Dependencies

  • node:fs
  • node:path
  • vitest
  • ~utils

Frequently Asked Questions

What does worker-es.spec.ts do?
worker-es.spec.ts is a source file in the vite codebase, written in typescript.
What does worker-es.spec.ts depend on?
worker-es.spec.ts imports 4 module(s): node:fs, node:path, vitest, ~utils.
Where is worker-es.spec.ts in the architecture?
worker-es.spec.ts is located at playground/worker/__tests__/es/worker-es.spec.ts (directory: playground/worker/__tests__/es).

Analyze Your Own Codebase

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

Try Supermodel Free