Home / File/ format-ns.test.ts — tailwindcss Source File

format-ns.test.ts — tailwindcss Source File

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

Entity Profile

Dependency Diagram

graph LR
  e0e4b353_1746_cf12_c054_4c01c910409f["format-ns.test.ts"]
  668a6c78_97ae_1a3a_8906_d42fe854fff0["format-ns.ts"]
  e0e4b353_1746_cf12_c054_4c01c910409f --> 668a6c78_97ae_1a3a_8906_d42fe854fff0
  8f39fcf0_a336_611c_df3e_e1ab37efa73a["formatNanoseconds"]
  e0e4b353_1746_cf12_c054_4c01c910409f --> 8f39fcf0_a336_611c_df3e_e1ab37efa73a
  f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3["vitest"]
  e0e4b353_1746_cf12_c054_4c01c910409f --> f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3
  style e0e4b353_1746_cf12_c054_4c01c910409f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { expect, it } from 'vitest'
import { formatNanoseconds } from './format-ns'

it.each([
  [0, '0ns'],
  [1, '1ns'],
  [999, '999ns'],
  [1000, '1µs'],
  [1001, '1µs'],
  [999999, '999µs'],
  [1000000, '1ms'],
  [1000001, '1ms'],
  [999999999, '999ms'],
  [1000000000, '1s'],
  [1000000001, '1s'],
  [59999999999, '59s'],
  [60000000000, '1m'],
  [60000000001, '1m'],
  [3599999999999n, '59m'],
  [3600000000000n, '1h'],
  [3600000000001n, '1h'],
  [86399999999999n, '23h'],
  [86400000000000n, '1d'],
  [86400000000001n, '1d'],
  [8640000000000000n, '100d'],
])('should format %s nanoseconds as %s', (ns, expected) => {
  expect(formatNanoseconds(ns)).toBe(expected)
})

Dependencies

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free