Home / File/ value-parser.test.ts — tailwindcss Source File

value-parser.test.ts — tailwindcss Source File

Architecture documentation for value-parser.test.ts, a typescript file in the tailwindcss codebase. 7 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  d2ae45a7_1ccb_97a3_dc46_c7b09f369b25["value-parser.test.ts"]
  1d3f1613_f144_938f_08f7_49039a46ad49["value-parser.ts"]
  d2ae45a7_1ccb_97a3_dc46_c7b09f369b25 --> 1d3f1613_f144_938f_08f7_49039a46ad49
  2d6c8361_96d8_df0d_ca51_c62f179fdc73["parse"]
  d2ae45a7_1ccb_97a3_dc46_c7b09f369b25 --> 2d6c8361_96d8_df0d_ca51_c62f179fdc73
  e79308d2_473f_b6d6_3b04_e4e55c2708d3["toCss"]
  d2ae45a7_1ccb_97a3_dc46_c7b09f369b25 --> e79308d2_473f_b6d6_3b04_e4e55c2708d3
  d1b39b63_c9d5_6c28_0206_0ddc8b895876["walk.ts"]
  d2ae45a7_1ccb_97a3_dc46_c7b09f369b25 --> d1b39b63_c9d5_6c28_0206_0ddc8b895876
  ed78da58_8727_ad98_120c_61f35cea357a["walk"]
  d2ae45a7_1ccb_97a3_dc46_c7b09f369b25 --> ed78da58_8727_ad98_120c_61f35cea357a
  7b34c369_d799_30f1_b751_6e3fd5349f6b["WalkAction"]
  d2ae45a7_1ccb_97a3_dc46_c7b09f369b25 --> 7b34c369_d799_30f1_b751_6e3fd5349f6b
  696bd648_5f24_1b59_8e8b_7a97a692869e["vitest"]
  d2ae45a7_1ccb_97a3_dc46_c7b09f369b25 --> 696bd648_5f24_1b59_8e8b_7a97a692869e
  style d2ae45a7_1ccb_97a3_dc46_c7b09f369b25 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { describe, expect, it } from 'vitest'
import { parse, toCss } from './value-parser'
import { walk, WalkAction } from './walk'

describe('parse', () => {
  it('should parse a value', () => {
    expect(parse('123px')).toEqual([{ kind: 'word', value: '123px' }])
  })

  it('should parse a string value', () => {
    expect(parse("'hello world'")).toEqual([{ kind: 'word', value: "'hello world'" }])
  })

  it('should parse a list', () => {
    expect(parse('hello world')).toEqual([
      { kind: 'word', value: 'hello' },
      { kind: 'separator', value: ' ' },
      { kind: 'word', value: 'world' },
    ])
  })

  it('should parse a string containing parentheses', () => {
    expect(parse("'hello ( world )'")).toEqual([{ kind: 'word', value: "'hello ( world )'" }])
  })

  it('should parse a function with no arguments', () => {
    expect(parse('theme()')).toEqual([{ kind: 'function', value: 'theme', nodes: [] }])
  })

  it('should parse a function with a single argument', () => {
    expect(parse('theme(foo)')).toEqual([
      { kind: 'function', value: 'theme', nodes: [{ kind: 'word', value: 'foo' }] },
    ])
  })

  it('should parse a function with a single string argument', () => {
    expect(parse("theme('foo')")).toEqual([
      { kind: 'function', value: 'theme', nodes: [{ kind: 'word', value: "'foo'" }] },
    ])
  })

  it('should parse a function with multiple arguments', () => {
    expect(parse('theme(foo, bar)')).toEqual([
      {
        kind: 'function',
        value: 'theme',
        nodes: [
          { kind: 'word', value: 'foo' },
          { kind: 'separator', value: ', ' },
          { kind: 'word', value: 'bar' },
        ],
      },
    ])
  })

  it('should parse a function with multiple arguments across lines', () => {
    expect(parse('theme(\n\tfoo,\n\tbar\n)')).toEqual([
      {
        kind: 'function',
        value: 'theme',
// ... (160 more lines)

Domain

Frequently Asked Questions

What does value-parser.test.ts do?
value-parser.test.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the OxideEngine domain.
What does value-parser.test.ts depend on?
value-parser.test.ts imports 7 module(s): WalkAction, parse, toCss, value-parser.ts, vitest, walk, walk.ts.
Where is value-parser.test.ts in the architecture?
value-parser.test.ts is located at packages/tailwindcss/src/value-parser.test.ts (domain: OxideEngine, directory: packages/tailwindcss/src).

Analyze Your Own Codebase

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

Try Supermodel Free