Home / File/ alias.spec.ts — vite Source File

alias.spec.ts — vite Source File

Architecture documentation for alias.spec.ts, a typescript file in the vite codebase. 2 imports, 0 dependents.

File typescript 2 imports

Entity Profile

Dependency Diagram

graph LR
  7c22aca0_15df_ba98_3b58_6a7cc5892465["alias.spec.ts"]
  a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"]
  7c22aca0_15df_ba98_3b58_6a7cc5892465 --> a340ba46_b2b7_3048_3bb3_6907a74c8464
  d3fd5575_295b_d6be_24dd_62d277645dc9["~utils"]
  7c22aca0_15df_ba98_3b58_6a7cc5892465 --> d3fd5575_295b_d6be_24dd_62d277645dc9
  style 7c22aca0_15df_ba98_3b58_6a7cc5892465 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { expect, test } from 'vitest'
import { editFile, getColor, isBuild, page } from '~utils'

test('fs', async () => {
  expect(await page.textContent('.fs')).toMatch('[success] alias to fs path')
})

test('fs directory', async () => {
  expect(await page.textContent('.fs-dir')).toMatch(
    '[success] alias to directory',
  )
})

test('regex', async () => {
  expect(await page.textContent('.regex')).toMatch(
    '[success] alias to directory via regex',
  )
})

test('dependency', async () => {
  expect(await page.textContent('.dep')).toMatch('[success] out of root')
})

test('js via script src', async () => {
  expect(await page.textContent('.from-script-src')).toMatch(
    '[success] from script src',
  )
})

test('css via link', async () => {
  expect(await getColor('body')).toBe('grey')
  if (isBuild) return
  editFile('dir/test.css', (code) => code.replace('grey', 'red'))
  await expect.poll(() => getColor('body')).toBe('red')
})

test('optimized dep', async () => {
  expect(await page.textContent('.optimized')).toMatch(
    '[success] alias optimized',
  )
})

test('aliased module', async () => {
  expect(await page.textContent('.aliased-module')).toMatch(
    '[success] aliased module',
  )
})

test('url conflict alias', async () => {
  expect(await page.textContent('.url-conflict')).toMatch(
    '[success] url conflict alias',
  )
})

test('custom resolver', async () => {
  expect(await page.textContent('.custom-resolver')).toMatch(
    '[success] alias to custom-resolver path',
  )
})

Dependencies

  • vitest
  • ~utils

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free