Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions packages/cli-kit/src/public/node/global-context.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {getCurrentCommandId, setCurrentCommandId} from './global-context.js'
import {afterEach, describe, expect, test} from 'vitest'

describe('global-context', () => {
afterEach(() => {
setCurrentCommandId('')
})

test('getCurrentCommandId returns empty string by default', () => {
// When
const got = getCurrentCommandId()

// Then
expect(got).toBe('')
})

test('setCurrentCommandId updates current command ID', () => {
// Given
const commandId = 'app:dev'

// When
setCurrentCommandId(commandId)

// Then
expect(getCurrentCommandId()).toBe('app:dev')
})
})
Loading