Home / File/ assets-encoded-base.spec.ts — vite Source File

assets-encoded-base.spec.ts — vite Source File

Architecture documentation for assets-encoded-base.spec.ts, a typescript file in the vite codebase. 2 imports, 0 dependents.

File typescript 2 imports

Entity Profile

Dependency Diagram

graph LR
  9341ab5f_0368_5792_fa31_b8deaf360718["assets-encoded-base.spec.ts"]
  a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"]
  9341ab5f_0368_5792_fa31_b8deaf360718 --> a340ba46_b2b7_3048_3bb3_6907a74c8464
  d3fd5575_295b_d6be_24dd_62d277645dc9["~utils"]
  9341ab5f_0368_5792_fa31_b8deaf360718 --> d3fd5575_295b_d6be_24dd_62d277645dc9
  style 9341ab5f_0368_5792_fa31_b8deaf360718 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { beforeAll, describe, expect, test } from 'vitest'
import {
  browserLogs,
  findAssetFile,
  getBg,
  getColor,
  isBuild,
  page,
} from '~utils'

const urlAssetMatch = isBuild
  ? /\/foo%20bar\/other-assets\/asset-[-\w]{8}\.png/
  : '/nested/asset.png'

const iconMatch = '/icon.png'

const absoluteIconMatch = isBuild
  ? /\/foo%20bar\/.*\/icon-[-\w]{8}\.png/
  : '/nested/icon.png'

const absolutePublicIconMatch = isBuild ? /\/foo%20bar\/icon\.png/ : '/icon.png'

test('should have no 404s', () => {
  browserLogs.forEach((msg) => {
    expect(msg).not.toMatch('404')
  })
})

describe('raw references from /public', () => {
  test('load raw js from /public', async () => {
    expect(await page.textContent('.raw-js')).toMatch('[success]')
  })

  test('load raw css from /public', async () => {
    expect(await getColor('.raw-css')).toBe('red')
  })
})

test('import-expression from simple script', async () => {
  expect(await page.textContent('.import-expression')).toMatch(
    '[success][success]',
  )
})

describe('asset imports from js', () => {
  test('relative', async () => {
    expect(await page.textContent('.asset-import-relative')).toMatch(
      urlAssetMatch,
    )
  })

  test('absolute', async () => {
    expect(await page.textContent('.asset-import-absolute')).toMatch(
      urlAssetMatch,
    )
  })

  test('from /public', async () => {
    expect(await page.textContent('.public-import')).toMatch(
      absolutePublicIconMatch,
// ... (170 more lines)

Dependencies

  • vitest
  • ~utils

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free