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

static.spec.ts — vite Source File

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

Entity Profile

Dependency Diagram

graph LR
  afe3a19c_a6c7_672c_7de7_7fb4ca8b5204["static.spec.ts"]
  d91d6c8f_e2c2_3b92_12c3_391c9ba06183["static.ts"]
  afe3a19c_a6c7_672c_7de7_7fb4ca8b5204 --> d91d6c8f_e2c2_3b92_12c3_391c9ba06183
  2c797df0_6f8d_bb30_24cf_3a4eff202dbc["isFileInTargetPath"]
  afe3a19c_a6c7_672c_7de7_7fb4ca8b5204 --> 2c797df0_6f8d_bb30_24cf_3a4eff202dbc
  a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"]
  afe3a19c_a6c7_672c_7de7_7fb4ca8b5204 --> a340ba46_b2b7_3048_3bb3_6907a74c8464
  style afe3a19c_a6c7_672c_7de7_7fb4ca8b5204 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { describe, expect, test } from 'vitest'
import { isFileInTargetPath } from '../static'

describe('isFileInTargetPath', () => {
  const cases = {
    '/parent': {
      '/parent': true,
      '/parenta': false,
      '/parent/': true,
      '/parent/child': true,
      '/parent/child/child2': true,
    },
    '/parent/': {
      '/parent': false,
      '/parenta': false,
      '/parent/': true,
      '/parent/child': true,
      '/parent/child/child2': true,
    },
  }

  for (const [parent, children] of Object.entries(cases)) {
    for (const [child, expected] of Object.entries(children)) {
      test(`isFileInTargetPath("${parent}", "${child}")`, () => {
        expect(isFileInTargetPath(parent, child)).toBe(expected)
      })
    }
  }
})

Domain

Dependencies

Frequently Asked Questions

What does static.spec.ts do?
static.spec.ts is a source file in the vite codebase, written in typescript. It belongs to the ViteCore domain.
What does static.spec.ts depend on?
static.spec.ts imports 3 module(s): isFileInTargetPath, static.ts, vitest.
Where is static.spec.ts in the architecture?
static.spec.ts is located at packages/vite/src/node/server/middlewares/__tests__/static.spec.ts (domain: ViteCore, directory: packages/vite/src/node/server/middlewares/__tests__).

Analyze Your Own Codebase

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

Try Supermodel Free