Home / File/ worker-relative-base.spec.ts — vite Source File

worker-relative-base.spec.ts — vite Source File

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

File typescript 4 imports

Entity Profile

Dependency Diagram

graph LR
  0865d930_88e2_f4c1_3198_3b1d188655c3["worker-relative-base.spec.ts"]
  e6032fbc_44cf_58d6_868d_dd15106c18c5["node:fs"]
  0865d930_88e2_f4c1_3198_3b1d188655c3 --> e6032fbc_44cf_58d6_868d_dd15106c18c5
  51e96894_3556_ed5c_1ede_97d449867adf["node:path"]
  0865d930_88e2_f4c1_3198_3b1d188655c3 --> 51e96894_3556_ed5c_1ede_97d449867adf
  a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"]
  0865d930_88e2_f4c1_3198_3b1d188655c3 --> a340ba46_b2b7_3048_3bb3_6907a74c8464
  d3fd5575_295b_d6be_24dd_62d277645dc9["~utils"]
  0865d930_88e2_f4c1_3198_3b1d188655c3 --> d3fd5575_295b_d6be_24dd_62d277645dc9
  style 0865d930_88e2_f4c1_3198_3b1d188655c3 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 ? '/worker-assets/worker_asset-vite' : '/vite.svg')
})

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')
})

// TODO: inline worker should inline assets
test.skip('inlined', async () => {
  await expect.poll(() => page.textContent('.pong-inline')).toMatch('pong')
})

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

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

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

test('worker emitted and import.meta.url in nested worker (serve)', async () => {
  await expect
    .poll(() => page.textContent('.nested-worker'))
    .toMatch('worker-nested-worker')
  await expect
    .poll(() => page.textContent('.nested-worker-module'))
    .toMatch('sub-worker')
  await expect
    .poll(() => page.textContent('.nested-worker-constructor'))
    .toMatch('"type":"constructor"')
})

describe.runIf(isBuild)('build', () => {
// ... (93 more lines)

Dependencies

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

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free