Home / File/ args.test.ts — tailwindcss Source File

args.test.ts — tailwindcss Source File

Architecture documentation for args.test.ts, a typescript file in the tailwindcss codebase. 3 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  0ad4ccb7_fa4f_cb92_7a74_15469bdbe213["args.test.ts"]
  fa5b7a74_b00e_9eb4_ab63_8b8413ceff3b["args.ts"]
  0ad4ccb7_fa4f_cb92_7a74_15469bdbe213 --> fa5b7a74_b00e_9eb4_ab63_8b8413ceff3b
  51261aff_bb19_0370_eda1_f79dc0960671["args"]
  0ad4ccb7_fa4f_cb92_7a74_15469bdbe213 --> 51261aff_bb19_0370_eda1_f79dc0960671
  f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3["vitest"]
  0ad4ccb7_fa4f_cb92_7a74_15469bdbe213 --> f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3
  style 0ad4ccb7_fa4f_cb92_7a74_15469bdbe213 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { expect, it } from 'vitest'
import { args, type Arg } from './args'

it('should be possible to parse a single argument', () => {
  expect(
    args(
      {
        '--input': { type: 'string', description: 'Input file' },
      },
      ['--input', 'input.css'],
    ),
  ).toMatchInlineSnapshot(`
    {
      "--input": "input.css",
      "_": [],
    }
  `)
})

it('should fallback to the default value if no flag is passed', () => {
  expect(
    args(
      {
        '--input': { type: 'string', description: 'Input file', default: 'input.css' },
      },
      ['--other'],
    ),
  ).toMatchInlineSnapshot(`
    {
      "--input": "input.css",
      "_": [],
    }
  `)
})

it('should fallback to null if no flag is passed and no default value is provided', () => {
  expect(
    args(
      {
        '--input': { type: 'string', description: 'Input file' },
      },
      ['--other'],
    ),
  ).toMatchInlineSnapshot(`
    {
      "--input": null,
      "_": [],
    }
  `)
})

it('should be possible to parse a single argument using the shorthand alias', () => {
  expect(
    args(
      {
        '--input': { type: 'string', description: 'Input file', alias: '-i' },
      },
      ['-i', 'input.css'],
    ),
  ).toMatchInlineSnapshot(`
// ... (64 more lines)

Dependencies

Frequently Asked Questions

What does args.test.ts do?
args.test.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the CommandLineInterface domain.
What does args.test.ts depend on?
args.test.ts imports 3 module(s): args, args.ts, vitest.
Where is args.test.ts in the architecture?
args.test.ts is located at packages/@tailwindcss-upgrade/src/utils/args.test.ts (domain: CommandLineInterface, directory: packages/@tailwindcss-upgrade/src/utils).

Analyze Your Own Codebase

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

Try Supermodel Free