diff --git a/packages/cli-kit/src/public/node/global-context.test.ts b/packages/cli-kit/src/public/node/global-context.test.ts new file mode 100644 index 00000000000..2c64c253da7 --- /dev/null +++ b/packages/cli-kit/src/public/node/global-context.test.ts @@ -0,0 +1,17 @@ +import {getCurrentCommandId, setCurrentCommandId} from './global-context.js' +import {afterEach, describe, expect, test} from 'vitest' + +describe('global-context', () => { + afterEach(() => { + setCurrentCommandId('') + }) + + test('returns empty string as default command ID', () => { + expect(getCurrentCommandId()).toBe('') + }) + + test('sets and gets current command ID', () => { + setCurrentCommandId('test-command-123') + expect(getCurrentCommandId()).toBe('test-command-123') + }) +})