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

instrumentation.test.ts — tailwindcss Source File

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

Entity Profile

Dependency Diagram

graph LR
  9df669a7_27e4_56bb_f565_483b013f93e7["instrumentation.test.ts"]
  bd16b7ea_bbf0_4269_b855_66ce2c516e3e["instrumentation.ts"]
  9df669a7_27e4_56bb_f565_483b013f93e7 --> bd16b7ea_bbf0_4269_b855_66ce2c516e3e
  8a5a53c8_b056_fb86_4bf2_308f1ad171e8["Instrumentation"]
  9df669a7_27e4_56bb_f565_483b013f93e7 --> 8a5a53c8_b056_fb86_4bf2_308f1ad171e8
  09e430a1_e718_7391_a47b_237d0e4ebfdc["util"]
  9df669a7_27e4_56bb_f565_483b013f93e7 --> 09e430a1_e718_7391_a47b_237d0e4ebfdc
  f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3["vitest"]
  9df669a7_27e4_56bb_f565_483b013f93e7 --> f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3
  style 9df669a7_27e4_56bb_f565_483b013f93e7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { stripVTControlCharacters } from 'util'
import { expect, it } from 'vitest'
import { Instrumentation } from './instrumentation'

it('should add instrumentation', () => {
  let I = new Instrumentation()

  I.start('Foo')
  let x = 1
  for (let i = 0; i < 100; i++) {
    I.start('Bar')
    x **= 2
    I.end('Bar')
  }
  I.end('Foo')

  I.hit('Potato')
  I.hit('Potato')
  I.hit('Potato')
  I.hit('Potato')

  expect.assertions(1)

  I.report((output) => {
    expect(stripVTControlCharacters(output).replace(/\[.*\]/g, '[0.xxms]')).toMatchInlineSnapshot(`
      "
      Hits:
        Potato × 4

      Timers:
      [0.xxms] Foo
      [0.xxms]   ↳ Bar × 100
      "
    `)
  })
})

it('should auto end pending timers when reporting', () => {
  let I = new Instrumentation()

  I.start('Foo')
  let x = 1
  for (let i = 0; i < 100; i++) {
    I.start('Bar')
    x **= 2
    I.end('Bar')
  }
  I.start('Baz')

  expect.assertions(1)

  I.report((output) => {
    expect(stripVTControlCharacters(output).replace(/\[.*\]/g, '[0.xxms]')).toMatchInlineSnapshot(`
      "
      [0.xxms] Foo
      [0.xxms]   ↳ Bar × 100
      [0.xxms]   ↳ Baz
      "
    `)
  })
})

Domain

Dependencies

Frequently Asked Questions

What does instrumentation.test.ts do?
instrumentation.test.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the NodeServer domain.
What does instrumentation.test.ts depend on?
instrumentation.test.ts imports 4 module(s): Instrumentation, instrumentation.ts, util, vitest.
Where is instrumentation.test.ts in the architecture?
instrumentation.test.ts is located at packages/@tailwindcss-node/src/instrumentation.test.ts (domain: NodeServer, directory: packages/@tailwindcss-node/src).

Analyze Your Own Codebase

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

Try Supermodel Free