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

utils.spec.ts — vite Source File

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

Entity Profile

Dependency Diagram

graph LR
  680d1fce_52fe_fc5f_c9b9_27adb2fa3df9["utils.spec.ts"]
  b68d9c02_4026_8cfa_8eb1_35ec4a8f23cb["importMetaGlob.ts"]
  680d1fce_52fe_fc5f_c9b9_27adb2fa3df9 --> b68d9c02_4026_8cfa_8eb1_35ec4a8f23cb
  b2546add_ed59_4395_9214_0c3fc0d07b41["getCommonBase"]
  680d1fce_52fe_fc5f_c9b9_27adb2fa3df9 --> b2546add_ed59_4395_9214_0c3fc0d07b41
  a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"]
  680d1fce_52fe_fc5f_c9b9_27adb2fa3df9 --> a340ba46_b2b7_3048_3bb3_6907a74c8464
  style 680d1fce_52fe_fc5f_c9b9_27adb2fa3df9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { describe, expect, it } from 'vitest'
import { getCommonBase } from '../../../plugins/importMetaGlob'

describe('getCommonBase()', async () => {
  it('basic', () => {
    expect(getCommonBase(['/a/b/*.js', '/a/c/*.js'])).toBe('/a')
  })
  it('common base', () => {
    expect(getCommonBase(['/a/b/**/*.vue', '/a/b/**/*.jsx'])).toBe('/a/b')
  })
  it('static file', () => {
    expect(
      getCommonBase(['/a/b/**/*.vue', '/a/b/**/*.jsx', '/a/b/foo.js']),
    ).toBe('/a/b')
    expect(getCommonBase(['/a/b/**/*.vue', '/a/b/**/*.jsx', '/a/foo.js'])).toBe(
      '/a',
    )
  })
  it('correct `scan()`', () => {
    expect(getCommonBase(['/a/*.vue'])).toBe('/a')
    expect(getCommonBase(['/a/some.vue'])).toBe('/a')
    expect(getCommonBase(['/a/b/**/c/foo.vue', '/a/b/c/**/*.jsx'])).toBe('/a/b')
  })
  it('single', () => {
    expect(getCommonBase(['/a/b/c/*.vue'])).toBe('/a/b/c')
    expect(getCommonBase(['/a/b/c/foo.vue'])).toBe('/a/b/c')
  })
  it('no common base', () => {
    expect(getCommonBase(['/a/b/*.js', '/c/a/b/*.js'])).toBe('/')
  })
})

Domain

Dependencies

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free