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

constants.spec.ts — vite Source File

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

Entity Profile

Dependency Diagram

graph LR
  77df6aca_f424_d78e_77d2_9c703cf821e6["constants.spec.ts"]
  545df65b_7f67_94d3_e2e8_a592d5e64b8f["constants.ts"]
  77df6aca_f424_d78e_77d2_9c703cf821e6 --> 545df65b_7f67_94d3_e2e8_a592d5e64b8f
  a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"]
  77df6aca_f424_d78e_77d2_9c703cf821e6 --> a340ba46_b2b7_3048_3bb3_6907a74c8464
  style 77df6aca_f424_d78e_77d2_9c703cf821e6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { expect, test } from 'vitest'
import { defaultAllowedOrigins } from '../constants'

test('defaultAllowedOrigins', () => {
  const allowed = [
    'http://localhost',
    'http://foo.localhost',
    'http://localhost:3000',
    'https://localhost:3000',
    'http://127.0.0.1',
    'http://[::1]',
    'http://[::1]:3000',
  ]
  const denied = [
    'file:///foo',
    'http://localhost.example.com',
    'http://foo.example.com:localhost',
    'http://',
    'http://192.0.2',
    'http://[2001:db8::1]',
    'http://vite',
    'http://vite:3000',
  ]

  for (const origin of allowed) {
    expect(defaultAllowedOrigins.test(origin), origin).toBe(true)
  }

  for (const origin of denied) {
    expect(defaultAllowedOrigins.test(origin), origin).toBe(false)
  }
})

Domain

Dependencies

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free