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..9f130b4fcb5 --- /dev/null +++ b/packages/cli-kit/src/public/node/global-context.test.ts @@ -0,0 +1,20 @@ +import {getCurrentCommandId, setCurrentCommandId} from './global-context.js' +import {describe, expect, test} from 'vitest' + +describe('global-context', () => { + test('returns empty string by default for command ID', () => { + // When/Then + expect(getCurrentCommandId()).toBe('') + }) + + test('sets and gets the current command ID correctly', () => { + // Given + const testCommandId = 'my-test-command' + + // When + setCurrentCommandId(testCommandId) + + // Then + expect(getCurrentCommandId()).toBe(testCommandId) + }) +})