11import { jest } from '@jest/globals'
22
3- import { ArgumentsCamelCase , Argv } from 'yargs'
3+ import type { ArgumentsCamelCase , Argv } from 'yargs'
44
5- import { Location , LocationsEndpoint , SmartThingsClient } from '@smartthings/core-sdk'
5+ import type { Location , LocationsEndpoint , SmartThingsClient } from '@smartthings/core-sdk'
66
7- import { APICommand , APICommandFlags , apiCommand , apiCommandBuilder , apiDocsURL } from '../../lib/command/api-command.js'
8- import { outputItemOrList , outputItemOrListBuilder } from '../../lib/command/listing-io.js'
9- import { CommandArgs } from '../../commands/locations.js'
7+ import type { APICommand , APICommandFlags } from '../../lib/command/api-command.js'
8+ import type { outputItemOrList , outputItemOrListBuilder } from '../../lib/command/listing-io.js'
9+ import type { CommandArgs } from '../../commands/locations.js'
10+ import { apiCommandMocks } from '../test-lib/api-command-mock.js'
1011import { buildArgvMock , buildArgvMockStub } from '../test-lib/builder-mock.js'
1112
1213
13-
14- const apiCommandMock = jest . fn < typeof apiCommand > ( )
15- const apiCommandBuilderMock = jest . fn < typeof apiCommandBuilder > ( )
16- const apiDocsURLMock = jest . fn < typeof apiDocsURL > ( )
17- jest . unstable_mockModule ( '../../lib/command/api-command.js' , ( ) => ( {
18- apiCommand : apiCommandMock ,
19- apiCommandBuilder : apiCommandBuilderMock ,
20- apiDocsURL : apiDocsURLMock ,
21- } ) )
14+ const { apiCommandMock, apiCommandBuilderMock } = apiCommandMocks ( '../..' )
2215
2316const outputItemOrListMock = jest . fn < typeof outputItemOrList > ( )
2417const outputItemOrListBuilderMock = jest . fn < typeof outputItemOrListBuilder > ( )
@@ -28,7 +21,6 @@ jest.unstable_mockModule('../../lib/command/listing-io.js', () => ({
2821} ) )
2922
3023
31-
3224const { default : cmd } = await import ( '../../commands/locations.js' )
3325
3426
0 commit comments