@sanity/cli 6.0.0-alpha.4 → 6.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/dev/startStudioDevServer.js +3 -8
- package/dist/actions/dev/startStudioDevServer.js.map +1 -1
- package/dist/actions/dev/types.d.ts +1 -3
- package/dist/actions/dev/types.js.map +1 -1
- package/dist/actions/documents/validate.d.ts +0 -2
- package/dist/actions/documents/validate.js +21 -1
- package/dist/actions/documents/validate.js.map +1 -1
- package/dist/actions/exec/execScript.js +1 -1
- package/dist/actions/exec/execScript.js.map +1 -1
- package/dist/actions/graphql/__tests__/getGraphQLAPIs.test.js +1 -1
- package/dist/actions/graphql/__tests__/getGraphQLAPIs.test.js.map +1 -1
- package/dist/actions/graphql/getGraphQLAPIs.js +1 -1
- package/dist/actions/graphql/getGraphQLAPIs.js.map +1 -1
- package/dist/actions/manifest/extractManifest.js +1 -4
- package/dist/actions/manifest/extractManifest.js.map +1 -1
- package/dist/actions/schema/deleteSchemaAction.d.ts +13 -5
- package/dist/actions/schema/deleteSchemaAction.js +12 -17
- package/dist/actions/schema/deleteSchemaAction.js.map +1 -1
- package/dist/actions/schema/deploySchemas.d.ts +15 -0
- package/dist/actions/schema/deploySchemas.js +98 -0
- package/dist/actions/schema/deploySchemas.js.map +1 -0
- package/dist/actions/schema/listSchemas.d.ts +12 -0
- package/dist/actions/schema/listSchemas.js +119 -0
- package/dist/actions/schema/listSchemas.js.map +1 -0
- package/dist/actions/schema/schemaStoreTypes.d.ts +0 -11
- package/dist/actions/schema/schemaStoreTypes.js.map +1 -1
- package/dist/actions/schema/utils/debug.d.ts +2 -0
- package/dist/actions/schema/utils/debug.js +5 -0
- package/dist/actions/schema/utils/debug.js.map +1 -0
- package/dist/actions/schema/utils/manifestExtractor.d.ts +3 -8
- package/dist/actions/schema/utils/manifestExtractor.js +12 -17
- package/dist/actions/schema/utils/manifestExtractor.js.map +1 -1
- package/dist/actions/schema/utils/manifestReader.d.ts +2 -9
- package/dist/actions/schema/utils/manifestReader.js +6 -12
- package/dist/actions/schema/utils/manifestReader.js.map +1 -1
- package/dist/actions/schema/utils/schemaStoreOutStrings.d.ts +0 -1
- package/dist/actions/schema/utils/schemaStoreOutStrings.js +1 -1
- package/dist/actions/schema/utils/schemaStoreOutStrings.js.map +1 -1
- package/dist/actions/schema/utils/schemaStoreValidation.d.ts +10 -62
- package/dist/actions/schema/utils/schemaStoreValidation.js +38 -125
- package/dist/actions/schema/utils/schemaStoreValidation.js.map +1 -1
- package/dist/actions/schema/utils/uniqByProjectIdDataset.d.ts +14 -0
- package/dist/actions/schema/utils/uniqByProjectIdDataset.js +9 -0
- package/dist/actions/schema/utils/uniqByProjectIdDataset.js.map +1 -0
- package/dist/actions/users/getMembersForProject.d.ts +1 -3
- package/dist/actions/users/getMembersForProject.js +6 -17
- package/dist/actions/users/getMembersForProject.js.map +1 -1
- package/dist/actions/users/types.d.ts +0 -11
- package/dist/actions/users/types.js.map +1 -1
- package/dist/commands/__tests__/debug.test.js +113 -220
- package/dist/commands/__tests__/debug.test.js.map +1 -1
- package/dist/commands/__tests__/deploy.test.js +325 -293
- package/dist/commands/__tests__/deploy.test.js.map +1 -1
- package/dist/commands/__tests__/dev.test.js +62 -19
- package/dist/commands/__tests__/dev.test.js.map +1 -1
- package/dist/commands/__tests__/init/init.authentication.test.js +40 -27
- package/dist/commands/__tests__/init/init.authentication.test.js.map +1 -1
- package/dist/commands/__tests__/init/init.create-new-project.test.js +84 -85
- package/dist/commands/__tests__/init/init.create-new-project.test.js.map +1 -1
- package/dist/commands/__tests__/init/init.plan.test.js +103 -44
- package/dist/commands/__tests__/init/init.plan.test.js.map +1 -1
- package/dist/commands/__tests__/init/init.setup.test.js +85 -29
- package/dist/commands/__tests__/init/init.setup.test.js.map +1 -1
- package/dist/commands/__tests__/install.test.js +46 -22
- package/dist/commands/__tests__/install.test.js.map +1 -1
- package/dist/commands/__tests__/logout.test.js +8 -5
- package/dist/commands/__tests__/logout.test.js.map +1 -1
- package/dist/commands/__tests__/manage.test.js +29 -24
- package/dist/commands/__tests__/manage.test.js.map +1 -1
- package/dist/commands/__tests__/versions.test.js +22 -14
- package/dist/commands/__tests__/versions.test.js.map +1 -1
- package/dist/commands/backup/__tests__/disable.test.js +72 -75
- package/dist/commands/backup/__tests__/disable.test.js.map +1 -1
- package/dist/commands/backup/__tests__/download.test.js +166 -77
- package/dist/commands/backup/__tests__/download.test.js.map +1 -1
- package/dist/commands/backup/__tests__/enable.test.js +109 -140
- package/dist/commands/backup/__tests__/enable.test.js.map +1 -1
- package/dist/commands/backup/__tests__/list.test.js +84 -75
- package/dist/commands/backup/__tests__/list.test.js.map +1 -1
- package/dist/commands/backup/disable.js +5 -11
- package/dist/commands/backup/disable.js.map +1 -1
- package/dist/commands/backup/enable.js +5 -11
- package/dist/commands/backup/enable.js.map +1 -1
- package/dist/commands/backup/list.js +7 -8
- package/dist/commands/backup/list.js.map +1 -1
- package/dist/commands/cors/__tests__/add.test.js +68 -38
- package/dist/commands/cors/__tests__/add.test.js.map +1 -1
- package/dist/commands/cors/__tests__/delete.test.js +52 -37
- package/dist/commands/cors/__tests__/delete.test.js.map +1 -1
- package/dist/commands/cors/__tests__/list.test.js +80 -57
- package/dist/commands/cors/__tests__/list.test.js.map +1 -1
- package/dist/commands/cors/add.js +5 -13
- package/dist/commands/cors/add.js.map +1 -1
- package/dist/commands/cors/delete.js +7 -15
- package/dist/commands/cors/delete.js.map +1 -1
- package/dist/commands/cors/list.js +2 -10
- package/dist/commands/cors/list.js.map +1 -1
- package/dist/commands/dataset/__tests__/copy.test.js +197 -89
- package/dist/commands/dataset/__tests__/copy.test.js.map +1 -1
- package/dist/commands/dataset/__tests__/create.test.js +147 -117
- package/dist/commands/dataset/__tests__/create.test.js.map +1 -1
- package/dist/commands/dataset/__tests__/delete.test.js +75 -68
- package/dist/commands/dataset/__tests__/delete.test.js.map +1 -1
- package/dist/commands/dataset/__tests__/export.test.js +123 -83
- package/dist/commands/dataset/__tests__/export.test.js.map +1 -1
- package/dist/commands/dataset/__tests__/list.test.js +107 -65
- package/dist/commands/dataset/__tests__/list.test.js.map +1 -1
- package/dist/commands/dataset/alias/__tests__/create.test.js +114 -74
- package/dist/commands/dataset/alias/__tests__/create.test.js.map +1 -1
- package/dist/commands/dataset/alias/__tests__/delete.test.js +40 -29
- package/dist/commands/dataset/alias/__tests__/delete.test.js.map +1 -1
- package/dist/commands/dataset/alias/__tests__/link.test.js +114 -74
- package/dist/commands/dataset/alias/__tests__/link.test.js.map +1 -1
- package/dist/commands/dataset/alias/__tests__/unlink.test.js +44 -29
- package/dist/commands/dataset/alias/__tests__/unlink.test.js.map +1 -1
- package/dist/commands/dataset/export.js +4 -4
- package/dist/commands/dataset/export.js.map +1 -1
- package/dist/commands/dataset/visibility/__tests__/get.test.js +48 -67
- package/dist/commands/dataset/visibility/__tests__/get.test.js.map +1 -1
- package/dist/commands/dataset/visibility/__tests__/set.test.js +76 -123
- package/dist/commands/dataset/visibility/__tests__/set.test.js.map +1 -1
- package/dist/commands/dev.js +0 -1
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/docs/__tests__/search.test.js +8 -7
- package/dist/commands/docs/__tests__/search.test.js.map +1 -1
- package/dist/commands/documents/__tests__/create.test.js +328 -265
- package/dist/commands/documents/__tests__/create.test.js.map +1 -1
- package/dist/commands/documents/__tests__/delete.test.js +119 -87
- package/dist/commands/documents/__tests__/delete.test.js.map +1 -1
- package/dist/commands/documents/__tests__/get.test.js +68 -95
- package/dist/commands/documents/__tests__/get.test.js.map +1 -1
- package/dist/commands/documents/__tests__/query.test.js +84 -189
- package/dist/commands/documents/__tests__/query.test.js.map +1 -1
- package/dist/commands/documents/__tests__/validate.test.js +52 -29
- package/dist/commands/documents/__tests__/validate.test.js.map +1 -1
- package/dist/commands/documents/create.d.ts +1 -0
- package/dist/commands/documents/create.js +10 -9
- package/dist/commands/documents/create.js.map +1 -1
- package/dist/commands/documents/delete.js +2 -3
- package/dist/commands/documents/delete.js.map +1 -1
- package/dist/commands/documents/get.js +2 -3
- package/dist/commands/documents/get.js.map +1 -1
- package/dist/commands/documents/query.js +2 -3
- package/dist/commands/documents/query.js.map +1 -1
- package/dist/commands/documents/validate.js +0 -20
- package/dist/commands/documents/validate.js.map +1 -1
- package/dist/commands/graphql/__tests__/list.test.js +57 -45
- package/dist/commands/graphql/__tests__/list.test.js.map +1 -1
- package/dist/commands/graphql/__tests__/undeploy.test.js +85 -59
- package/dist/commands/graphql/__tests__/undeploy.test.js.map +1 -1
- package/dist/commands/graphql/list.js +2 -2
- package/dist/commands/graphql/list.js.map +1 -1
- package/dist/commands/graphql/undeploy.js +4 -9
- package/dist/commands/graphql/undeploy.js.map +1 -1
- package/dist/commands/hook/__tests__/attempt.test.js +48 -33
- package/dist/commands/hook/__tests__/attempt.test.js.map +1 -1
- package/dist/commands/hook/__tests__/create.test.js +49 -51
- package/dist/commands/hook/__tests__/create.test.js.map +1 -1
- package/dist/commands/hook/__tests__/delete.test.js +43 -30
- package/dist/commands/hook/__tests__/delete.test.js.map +1 -1
- package/dist/commands/hook/__tests__/list.test.js +38 -31
- package/dist/commands/hook/__tests__/list.test.js.map +1 -1
- package/dist/commands/hook/__tests__/logs.test.js +68 -40
- package/dist/commands/hook/__tests__/logs.test.js.map +1 -1
- package/dist/commands/hook/create.js +2 -6
- package/dist/commands/hook/create.js.map +1 -1
- package/dist/commands/hook/delete.js +5 -17
- package/dist/commands/hook/delete.js.map +1 -1
- package/dist/commands/hook/list.js +2 -8
- package/dist/commands/hook/list.js.map +1 -1
- package/dist/commands/manifest/__tests__/extract.test.js +22 -13
- package/dist/commands/manifest/__tests__/extract.test.js.map +1 -1
- package/dist/commands/media/__tests__/create-aspect.test.js +41 -28
- package/dist/commands/media/__tests__/create-aspect.test.js.map +1 -1
- package/dist/commands/media/__tests__/delete-aspect.test.js +44 -35
- package/dist/commands/media/__tests__/delete-aspect.test.js.map +1 -1
- package/dist/commands/media/__tests__/deploy-aspect.test.js +67 -80
- package/dist/commands/media/__tests__/deploy-aspect.test.js.map +1 -1
- package/dist/commands/media/__tests__/export.test.js +365 -66
- package/dist/commands/media/__tests__/export.test.js.map +1 -1
- package/dist/commands/media/__tests__/import.test.js +171 -105
- package/dist/commands/media/__tests__/import.test.js.map +1 -1
- package/dist/commands/media/export.js +2 -2
- package/dist/commands/media/export.js.map +1 -1
- package/dist/commands/media/import.js +2 -2
- package/dist/commands/media/import.js.map +1 -1
- package/dist/commands/projects/__tests__/list.test.js +5 -4
- package/dist/commands/projects/__tests__/list.test.js.map +1 -1
- package/dist/commands/projects/list.js +2 -6
- package/dist/commands/projects/list.js.map +1 -1
- package/dist/commands/schema/__tests__/delete.test.js +396 -151
- package/dist/commands/schema/__tests__/delete.test.js.map +1 -1
- package/dist/commands/schema/__tests__/deploy.test.js +348 -0
- package/dist/commands/schema/__tests__/deploy.test.js.map +1 -0
- package/dist/commands/schema/__tests__/extract.test.js +19 -11
- package/dist/commands/schema/__tests__/extract.test.js.map +1 -1
- package/dist/commands/schema/__tests__/list.test.js +399 -0
- package/dist/commands/schema/__tests__/list.test.js.map +1 -0
- package/dist/commands/schema/__tests__/validate.test.js +27 -10
- package/dist/commands/schema/__tests__/validate.test.js.map +1 -1
- package/dist/commands/schema/delete.d.ts +1 -1
- package/dist/commands/schema/delete.js +20 -23
- package/dist/commands/schema/delete.js.map +1 -1
- package/dist/commands/schema/deploy.d.ts +16 -0
- package/dist/commands/schema/deploy.js +98 -0
- package/dist/commands/schema/deploy.js.map +1 -0
- package/dist/commands/schema/list.d.ts +15 -0
- package/dist/commands/schema/list.js +104 -0
- package/dist/commands/schema/list.js.map +1 -0
- package/dist/commands/telemetry/__tests__/disable.test.js +7 -5
- package/dist/commands/telemetry/__tests__/disable.test.js.map +1 -1
- package/dist/commands/telemetry/__tests__/enable.test.js +7 -5
- package/dist/commands/telemetry/__tests__/enable.test.js.map +1 -1
- package/dist/commands/telemetry/__tests__/status.test.js +7 -5
- package/dist/commands/telemetry/__tests__/status.test.js.map +1 -1
- package/dist/commands/tokens/__tests__/add.test.js +55 -40
- package/dist/commands/tokens/__tests__/add.test.js.map +1 -1
- package/dist/commands/tokens/__tests__/delete.test.js +72 -42
- package/dist/commands/tokens/__tests__/delete.test.js.map +1 -1
- package/dist/commands/tokens/__tests__/list.test.js +87 -60
- package/dist/commands/tokens/__tests__/list.test.js.map +1 -1
- package/dist/commands/tokens/add.js +3 -5
- package/dist/commands/tokens/add.js.map +1 -1
- package/dist/commands/users/__tests__/invite.test.js +100 -79
- package/dist/commands/users/__tests__/invite.test.js.map +1 -1
- package/dist/commands/users/__tests__/list.test.js +186 -180
- package/dist/commands/users/__tests__/list.test.js.map +1 -1
- package/dist/commands/users/invite.js +6 -17
- package/dist/commands/users/invite.js.map +1 -1
- package/dist/commands/users/list.js +4 -7
- package/dist/commands/users/list.js.map +1 -1
- package/dist/config/createCliConfig.d.ts +4 -4
- package/dist/services/backup.d.ts +8 -0
- package/dist/services/backup.js +19 -0
- package/dist/services/backup.js.map +1 -1
- package/dist/services/cors.d.ts +23 -0
- package/dist/services/cors.js +38 -0
- package/dist/services/cors.js.map +1 -0
- package/dist/services/graphql.d.ts +7 -0
- package/dist/services/graphql.js +11 -0
- package/dist/services/graphql.js.map +1 -1
- package/dist/services/hooks.d.ts +2 -0
- package/dist/services/hooks.js +19 -0
- package/dist/services/hooks.js.map +1 -1
- package/dist/services/organizations.d.ts +1 -1
- package/dist/services/organizations.js +1 -1
- package/dist/services/organizations.js.map +1 -1
- package/dist/services/projects.d.ts +11 -0
- package/dist/services/projects.js +41 -0
- package/dist/services/projects.js.map +1 -1
- package/dist/services/schemas.d.ts +4 -0
- package/dist/services/schemas.js +40 -0
- package/dist/services/schemas.js.map +1 -0
- package/dist/services/user.d.ts +8 -0
- package/dist/services/user.js +15 -2
- package/dist/services/user.js.map +1 -1
- package/dist/util/__tests__/getCliVersion.test.js +2 -2
- package/dist/util/__tests__/getCliVersion.test.js.map +1 -1
- package/dist/util/errorMessages.d.ts +1 -0
- package/dist/util/errorMessages.js +1 -0
- package/dist/util/errorMessages.js.map +1 -1
- package/dist/util/getCliVersion.js +1 -1
- package/dist/util/getCliVersion.js.map +1 -1
- package/dist/util/readPackageJson.d.ts +1 -15
- package/dist/util/readPackageJson.js +1 -1
- package/dist/util/readPackageJson.js.map +1 -1
- package/dist/util/uniqBy.d.ts +1 -0
- package/dist/util/uniqBy.js +14 -0
- package/dist/util/uniqBy.js.map +1 -0
- package/oclif.manifest.json +172 -27
- package/package.json +27 -28
- package/dist/actions/cors/constants.d.ts +0 -1
- package/dist/actions/cors/constants.js +0 -3
- package/dist/actions/cors/constants.js.map +0 -1
- package/dist/actions/cors/types.d.ts +0 -9
- package/dist/actions/cors/types.js +0 -3
- package/dist/actions/cors/types.js.map +0 -1
- package/dist/actions/schema/__tests__/deleteSchemaAction.test.js +0 -294
- package/dist/actions/schema/__tests__/deleteSchemaAction.test.js.map +0 -1
- package/dist/actions/schema/schemaStoreConstants.d.ts +0 -1
- package/dist/actions/schema/schemaStoreConstants.js +0 -4
- package/dist/actions/schema/schemaStoreConstants.js.map +0 -1
- package/dist/actions/schema/utils/schemaActionHelpers.d.ts +0 -1
- package/dist/actions/schema/utils/schemaActionHelpers.js +0 -5
- package/dist/actions/schema/utils/schemaActionHelpers.js.map +0 -1
- package/dist/actions/schema/utils/schemaApiClient.d.ts +0 -6
- package/dist/actions/schema/utils/schemaApiClient.js +0 -17
- package/dist/actions/schema/utils/schemaApiClient.js.map +0 -1
- package/dist/actions/users/apiVersion.d.ts +0 -6
- package/dist/actions/users/apiVersion.js +0 -7
- package/dist/actions/users/apiVersion.js.map +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import { runCommand } from '@oclif/test';
|
|
3
|
-
import { getCliConfig, getGlobalCliClient } from '@sanity/cli-core';
|
|
4
3
|
import { input, select } from '@sanity/cli-core/ux';
|
|
5
|
-
import { testCommand } from '@sanity/cli-test';
|
|
4
|
+
import { createTestToken, mockApi, testCommand } from '@sanity/cli-test';
|
|
6
5
|
import { exportDataset } from '@sanity/export';
|
|
6
|
+
import nock from 'nock';
|
|
7
7
|
import { afterEach, describe, expect, test, vi } from 'vitest';
|
|
8
|
+
import { MEDIA_LIBRARY_API_VERSION } from '../../../services/mediaLibraries.js';
|
|
8
9
|
import { NO_PROJECT_ID } from '../../../util/errorMessages.js';
|
|
9
10
|
import { MediaExportCommand } from '../export.js';
|
|
10
11
|
vi.mock('@sanity/export', ()=>({
|
|
@@ -18,23 +19,6 @@ vi.mock('@sanity/cli-core/ux', async ()=>{
|
|
|
18
19
|
select: vi.fn()
|
|
19
20
|
};
|
|
20
21
|
});
|
|
21
|
-
vi.mock('../../../../../cli-core/src/config/findProjectRoot.js', ()=>({
|
|
22
|
-
findProjectRoot: vi.fn().mockResolvedValue({
|
|
23
|
-
directory: '/test/path',
|
|
24
|
-
root: '/test/path',
|
|
25
|
-
type: 'studio'
|
|
26
|
-
})
|
|
27
|
-
}));
|
|
28
|
-
vi.mock('../../../../../cli-core/src/config/cli/getCliConfig.js', ()=>({
|
|
29
|
-
getCliConfig: vi.fn()
|
|
30
|
-
}));
|
|
31
|
-
vi.mock('../../../../../cli-core/src/services/getCliToken.js', ()=>({
|
|
32
|
-
getCliToken: vi.fn().mockResolvedValue('test-token')
|
|
33
|
-
}));
|
|
34
|
-
vi.mock('../../../../../cli-core/src/services/apiClient.js', ()=>({
|
|
35
|
-
getGlobalCliClient: vi.fn(),
|
|
36
|
-
getProjectCliClient: vi.fn()
|
|
37
|
-
}));
|
|
38
22
|
vi.mock('node:fs/promises', ()=>({
|
|
39
23
|
default: {
|
|
40
24
|
mkdir: vi.fn().mockResolvedValue(undefined),
|
|
@@ -44,8 +28,6 @@ vi.mock('node:fs/promises', ()=>({
|
|
|
44
28
|
const mockExportDataset = vi.mocked(exportDataset);
|
|
45
29
|
const mockInput = vi.mocked(input);
|
|
46
30
|
const mockSelect = vi.mocked(select);
|
|
47
|
-
const mockGetCliConfig = vi.mocked(getCliConfig);
|
|
48
|
-
const mockGetGlobalCliClient = vi.mocked(getGlobalCliClient);
|
|
49
31
|
const mockFs = vi.mocked(fs);
|
|
50
32
|
const TEST_CONFIG = {
|
|
51
33
|
MEDIA_LIBRARY_ID: 'test-media-library',
|
|
@@ -64,6 +46,20 @@ const ERROR_MESSAGES = {
|
|
|
64
46
|
NO_MEDIA_LIBRARIES: 'No active media libraries found',
|
|
65
47
|
USE_OVERWRITE: '--overwrite'
|
|
66
48
|
};
|
|
49
|
+
const defaultMocks = {
|
|
50
|
+
cliConfig: {
|
|
51
|
+
api: {
|
|
52
|
+
projectId: TEST_CONFIG.PROJECT_ID
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
projectRoot: {
|
|
56
|
+
directory: '/test/path',
|
|
57
|
+
path: '/test/path/sanity.config.ts',
|
|
58
|
+
root: '/test/path',
|
|
59
|
+
type: 'studio'
|
|
60
|
+
},
|
|
61
|
+
token: 'test-token'
|
|
62
|
+
};
|
|
67
63
|
const createTestContext = (overrides = {})=>{
|
|
68
64
|
const defaults = {
|
|
69
65
|
fileExists: false,
|
|
@@ -86,23 +82,6 @@ const createTestContext = (overrides = {})=>{
|
|
|
86
82
|
...defaults,
|
|
87
83
|
...overrides
|
|
88
84
|
};
|
|
89
|
-
// Setup CLI config
|
|
90
|
-
const apiConfig = {
|
|
91
|
-
projectId: context.projectId
|
|
92
|
-
};
|
|
93
|
-
mockGetCliConfig.mockResolvedValue({
|
|
94
|
-
api: apiConfig
|
|
95
|
-
});
|
|
96
|
-
// Setup client mock
|
|
97
|
-
const mockClient = {
|
|
98
|
-
config: ()=>({
|
|
99
|
-
projectId: context.projectId
|
|
100
|
-
}),
|
|
101
|
-
request: vi.fn().mockResolvedValue({
|
|
102
|
-
data: context.mediaLibraries
|
|
103
|
-
})
|
|
104
|
-
};
|
|
105
|
-
mockGetGlobalCliClient.mockResolvedValue(mockClient);
|
|
106
85
|
// Setup fs.stat mock
|
|
107
86
|
if (context.fileExists) {
|
|
108
87
|
mockFs.stat.mockResolvedValue({
|
|
@@ -118,11 +97,26 @@ const createTestContext = (overrides = {})=>{
|
|
|
118
97
|
if (context.selectValue) {
|
|
119
98
|
mockSelect.mockResolvedValue(context.selectValue);
|
|
120
99
|
}
|
|
121
|
-
|
|
100
|
+
// Return context with mocks for testCommand
|
|
101
|
+
return {
|
|
102
|
+
...context,
|
|
103
|
+
mocks: {
|
|
104
|
+
...defaultMocks,
|
|
105
|
+
cliConfig: {
|
|
106
|
+
api: {
|
|
107
|
+
projectId: context.projectId
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
122
112
|
};
|
|
123
113
|
describe('#media:export', ()=>{
|
|
124
114
|
afterEach(()=>{
|
|
125
115
|
vi.clearAllMocks();
|
|
116
|
+
vi.unstubAllEnvs();
|
|
117
|
+
const pending = nock.pendingMocks();
|
|
118
|
+
nock.cleanAll();
|
|
119
|
+
expect(pending, 'pending mocks').toEqual([]);
|
|
126
120
|
});
|
|
127
121
|
test('should show help text correctly', async ()=>{
|
|
128
122
|
const { stdout } = await runCommand([
|
|
@@ -166,12 +160,35 @@ describe('#media:export', ()=>{
|
|
|
166
160
|
`);
|
|
167
161
|
});
|
|
168
162
|
test('should export with provided destination', async ()=>{
|
|
169
|
-
|
|
170
|
-
|
|
163
|
+
mockApi({
|
|
164
|
+
apiVersion: MEDIA_LIBRARY_API_VERSION,
|
|
165
|
+
method: 'get',
|
|
166
|
+
query: {
|
|
167
|
+
projectId: TEST_CONFIG.PROJECT_ID
|
|
168
|
+
},
|
|
169
|
+
uri: '/media-libraries'
|
|
170
|
+
}).reply(200, {
|
|
171
|
+
data: [
|
|
172
|
+
{
|
|
173
|
+
id: TEST_CONFIG.MEDIA_LIBRARY_ID,
|
|
174
|
+
organizationId: 'org-1',
|
|
175
|
+
status: 'active'
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: 'another-library',
|
|
179
|
+
organizationId: 'org-1',
|
|
180
|
+
status: 'active'
|
|
181
|
+
}
|
|
182
|
+
]
|
|
171
183
|
});
|
|
184
|
+
createTestToken('test-token');
|
|
185
|
+
mockSelect.mockResolvedValue(TEST_CONFIG.MEDIA_LIBRARY_ID);
|
|
186
|
+
const ctx = createTestContext();
|
|
172
187
|
const { stderr, stdout } = await testCommand(MediaExportCommand, [
|
|
173
188
|
TEST_OUTPUTS.TAR_GZ
|
|
174
|
-
]
|
|
189
|
+
], {
|
|
190
|
+
mocks: ctx.mocks
|
|
191
|
+
});
|
|
175
192
|
expect(stderr).toBe('');
|
|
176
193
|
expect(stdout).toContain('Exporting from:');
|
|
177
194
|
expect(stdout).toContain(TEST_CONFIG.PROJECT_ID);
|
|
@@ -185,12 +202,36 @@ describe('#media:export', ()=>{
|
|
|
185
202
|
}));
|
|
186
203
|
});
|
|
187
204
|
test('should export with media library ID flag', async ()=>{
|
|
188
|
-
|
|
205
|
+
mockApi({
|
|
206
|
+
apiVersion: MEDIA_LIBRARY_API_VERSION,
|
|
207
|
+
method: 'get',
|
|
208
|
+
query: {
|
|
209
|
+
projectId: TEST_CONFIG.PROJECT_ID
|
|
210
|
+
},
|
|
211
|
+
uri: '/media-libraries'
|
|
212
|
+
}).reply(200, {
|
|
213
|
+
data: [
|
|
214
|
+
{
|
|
215
|
+
id: 'test-media-library',
|
|
216
|
+
organizationId: 'org-1',
|
|
217
|
+
status: 'active'
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: 'another-library',
|
|
221
|
+
organizationId: 'org-1',
|
|
222
|
+
status: 'active'
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
});
|
|
226
|
+
createTestToken('test-token');
|
|
227
|
+
const ctx = createTestContext();
|
|
189
228
|
const { stderr, stdout } = await testCommand(MediaExportCommand, [
|
|
190
229
|
TEST_OUTPUTS.TAR_GZ,
|
|
191
230
|
'--media-library-id',
|
|
192
231
|
TEST_CONFIG.MEDIA_LIBRARY_ID
|
|
193
|
-
]
|
|
232
|
+
], {
|
|
233
|
+
mocks: ctx.mocks
|
|
234
|
+
});
|
|
194
235
|
expect(stderr).toBe('');
|
|
195
236
|
expect(stdout).toContain('Export finished');
|
|
196
237
|
expect(mockSelect).not.toHaveBeenCalled();
|
|
@@ -199,70 +240,214 @@ describe('#media:export', ()=>{
|
|
|
199
240
|
}));
|
|
200
241
|
});
|
|
201
242
|
test('should prompt for media library when not provided', async ()=>{
|
|
202
|
-
|
|
243
|
+
mockApi({
|
|
244
|
+
apiVersion: MEDIA_LIBRARY_API_VERSION,
|
|
245
|
+
method: 'get',
|
|
246
|
+
query: {
|
|
247
|
+
projectId: TEST_CONFIG.PROJECT_ID
|
|
248
|
+
},
|
|
249
|
+
uri: '/media-libraries'
|
|
250
|
+
}).reply(200, {
|
|
251
|
+
data: [
|
|
252
|
+
{
|
|
253
|
+
id: 'test-media-library',
|
|
254
|
+
organizationId: 'org-1',
|
|
255
|
+
status: 'active'
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
id: 'another-library',
|
|
259
|
+
organizationId: 'org-1',
|
|
260
|
+
status: 'active'
|
|
261
|
+
}
|
|
262
|
+
]
|
|
263
|
+
});
|
|
264
|
+
createTestToken('test-token');
|
|
265
|
+
const ctx = createTestContext({
|
|
203
266
|
selectValue: TEST_CONFIG.MEDIA_LIBRARY_ID
|
|
204
267
|
});
|
|
205
268
|
await testCommand(MediaExportCommand, [
|
|
206
269
|
TEST_OUTPUTS.TAR_GZ
|
|
207
|
-
]
|
|
270
|
+
], {
|
|
271
|
+
mocks: ctx.mocks
|
|
272
|
+
});
|
|
208
273
|
expect(mockSelect).toHaveBeenCalledWith(expect.objectContaining({
|
|
209
274
|
message: 'Select media library:'
|
|
210
275
|
}));
|
|
211
276
|
});
|
|
212
277
|
test('should prompt for destination when not provided', async ()=>{
|
|
213
|
-
|
|
278
|
+
mockApi({
|
|
279
|
+
apiVersion: MEDIA_LIBRARY_API_VERSION,
|
|
280
|
+
method: 'get',
|
|
281
|
+
query: {
|
|
282
|
+
projectId: TEST_CONFIG.PROJECT_ID
|
|
283
|
+
},
|
|
284
|
+
uri: '/media-libraries'
|
|
285
|
+
}).reply(200, {
|
|
286
|
+
data: [
|
|
287
|
+
{
|
|
288
|
+
id: 'test-media-library',
|
|
289
|
+
organizationId: 'org-1',
|
|
290
|
+
status: 'active'
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
id: 'another-library',
|
|
294
|
+
organizationId: 'org-1',
|
|
295
|
+
status: 'active'
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
});
|
|
299
|
+
createTestToken('test-token');
|
|
300
|
+
const ctx = createTestContext({
|
|
214
301
|
inputValue: TEST_OUTPUTS.TAR_GZ,
|
|
215
302
|
selectValue: TEST_CONFIG.MEDIA_LIBRARY_ID
|
|
216
303
|
});
|
|
217
|
-
await testCommand(MediaExportCommand, []
|
|
304
|
+
await testCommand(MediaExportCommand, [], {
|
|
305
|
+
mocks: ctx.mocks
|
|
306
|
+
});
|
|
218
307
|
expect(mockInput).toHaveBeenCalledWith(expect.objectContaining({
|
|
219
308
|
message: 'Output path:'
|
|
220
309
|
}));
|
|
221
310
|
});
|
|
222
311
|
test('should error when file already exists without overwrite flag', async ()=>{
|
|
223
|
-
|
|
312
|
+
mockApi({
|
|
313
|
+
apiVersion: MEDIA_LIBRARY_API_VERSION,
|
|
314
|
+
method: 'get',
|
|
315
|
+
query: {
|
|
316
|
+
projectId: TEST_CONFIG.PROJECT_ID
|
|
317
|
+
},
|
|
318
|
+
uri: '/media-libraries'
|
|
319
|
+
}).reply(200, {
|
|
320
|
+
data: [
|
|
321
|
+
{
|
|
322
|
+
id: 'test-media-library',
|
|
323
|
+
organizationId: 'org-1',
|
|
324
|
+
status: 'active'
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
id: 'another-library',
|
|
328
|
+
organizationId: 'org-1',
|
|
329
|
+
status: 'active'
|
|
330
|
+
}
|
|
331
|
+
]
|
|
332
|
+
});
|
|
333
|
+
createTestToken('test-token');
|
|
334
|
+
const ctx = createTestContext({
|
|
224
335
|
fileExists: true,
|
|
225
336
|
selectValue: TEST_CONFIG.MEDIA_LIBRARY_ID
|
|
226
337
|
});
|
|
227
338
|
const { error } = await testCommand(MediaExportCommand, [
|
|
228
339
|
TEST_OUTPUTS.EXISTING
|
|
229
|
-
]
|
|
340
|
+
], {
|
|
341
|
+
mocks: ctx.mocks
|
|
342
|
+
});
|
|
230
343
|
expect(error?.message).toContain(ERROR_MESSAGES.ALREADY_EXISTS);
|
|
231
344
|
expect(error?.message).toContain(ERROR_MESSAGES.USE_OVERWRITE);
|
|
232
345
|
expect(error?.oclif?.exit).toBe(1);
|
|
233
346
|
});
|
|
234
347
|
test('should overwrite file when overwrite flag is provided', async ()=>{
|
|
235
|
-
|
|
348
|
+
mockApi({
|
|
349
|
+
apiVersion: MEDIA_LIBRARY_API_VERSION,
|
|
350
|
+
method: 'get',
|
|
351
|
+
query: {
|
|
352
|
+
projectId: TEST_CONFIG.PROJECT_ID
|
|
353
|
+
},
|
|
354
|
+
uri: '/media-libraries'
|
|
355
|
+
}).reply(200, {
|
|
356
|
+
data: [
|
|
357
|
+
{
|
|
358
|
+
id: 'test-media-library',
|
|
359
|
+
organizationId: 'org-1',
|
|
360
|
+
status: 'active'
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
id: 'another-library',
|
|
364
|
+
organizationId: 'org-1',
|
|
365
|
+
status: 'active'
|
|
366
|
+
}
|
|
367
|
+
]
|
|
368
|
+
});
|
|
369
|
+
createTestToken('test-token');
|
|
370
|
+
const ctx = createTestContext({
|
|
236
371
|
fileExists: true,
|
|
237
372
|
selectValue: TEST_CONFIG.MEDIA_LIBRARY_ID
|
|
238
373
|
});
|
|
239
374
|
const { stderr, stdout } = await testCommand(MediaExportCommand, [
|
|
240
375
|
TEST_OUTPUTS.EXISTING,
|
|
241
376
|
'--overwrite'
|
|
242
|
-
]
|
|
377
|
+
], {
|
|
378
|
+
mocks: ctx.mocks
|
|
379
|
+
});
|
|
243
380
|
expect(stderr).toBe('');
|
|
244
381
|
expect(stdout).toContain('Export finished');
|
|
245
382
|
});
|
|
246
383
|
test('should use directory and append default filename', async ()=>{
|
|
247
|
-
|
|
384
|
+
mockApi({
|
|
385
|
+
apiVersion: MEDIA_LIBRARY_API_VERSION,
|
|
386
|
+
method: 'get',
|
|
387
|
+
query: {
|
|
388
|
+
projectId: TEST_CONFIG.PROJECT_ID
|
|
389
|
+
},
|
|
390
|
+
uri: '/media-libraries'
|
|
391
|
+
}).reply(200, {
|
|
392
|
+
data: [
|
|
393
|
+
{
|
|
394
|
+
id: 'test-media-library',
|
|
395
|
+
organizationId: 'org-1',
|
|
396
|
+
status: 'active'
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
id: 'another-library',
|
|
400
|
+
organizationId: 'org-1',
|
|
401
|
+
status: 'active'
|
|
402
|
+
}
|
|
403
|
+
]
|
|
404
|
+
});
|
|
405
|
+
createTestToken('test-token');
|
|
406
|
+
const ctx = createTestContext({
|
|
248
407
|
fileExists: true,
|
|
249
408
|
isFile: false,
|
|
250
409
|
selectValue: TEST_CONFIG.MEDIA_LIBRARY_ID
|
|
251
410
|
});
|
|
252
411
|
await testCommand(MediaExportCommand, [
|
|
253
412
|
'some-directory'
|
|
254
|
-
]
|
|
413
|
+
], {
|
|
414
|
+
mocks: ctx.mocks
|
|
415
|
+
});
|
|
255
416
|
expect(mockExportDataset).toHaveBeenCalledWith(expect.objectContaining({
|
|
256
417
|
outputPath: expect.stringContaining(`${TEST_CONFIG.MEDIA_LIBRARY_ID}-export.tar.gz`)
|
|
257
418
|
}));
|
|
258
419
|
});
|
|
259
420
|
test('should export to stdout when destination is -', async ()=>{
|
|
260
|
-
|
|
421
|
+
mockApi({
|
|
422
|
+
apiVersion: MEDIA_LIBRARY_API_VERSION,
|
|
423
|
+
method: 'get',
|
|
424
|
+
query: {
|
|
425
|
+
projectId: TEST_CONFIG.PROJECT_ID
|
|
426
|
+
},
|
|
427
|
+
uri: '/media-libraries'
|
|
428
|
+
}).reply(200, {
|
|
429
|
+
data: [
|
|
430
|
+
{
|
|
431
|
+
id: 'test-media-library',
|
|
432
|
+
organizationId: 'org-1',
|
|
433
|
+
status: 'active'
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
id: 'another-library',
|
|
437
|
+
organizationId: 'org-1',
|
|
438
|
+
status: 'active'
|
|
439
|
+
}
|
|
440
|
+
]
|
|
441
|
+
});
|
|
442
|
+
createTestToken('test-token');
|
|
443
|
+
const ctx = createTestContext({
|
|
261
444
|
selectValue: TEST_CONFIG.MEDIA_LIBRARY_ID
|
|
262
445
|
});
|
|
263
446
|
await testCommand(MediaExportCommand, [
|
|
264
447
|
TEST_OUTPUTS.STDOUT
|
|
265
|
-
]
|
|
448
|
+
], {
|
|
449
|
+
mocks: ctx.mocks
|
|
450
|
+
});
|
|
266
451
|
expect(mockExportDataset).toHaveBeenCalledWith(expect.objectContaining({
|
|
267
452
|
outputPath: process.stdout
|
|
268
453
|
}));
|
|
@@ -300,8 +485,25 @@ describe('#media:export', ()=>{
|
|
|
300
485
|
setup: {}
|
|
301
486
|
}
|
|
302
487
|
])('should error when $scenario', async ({ additionalCheck, args, errorMessage, setup })=>{
|
|
303
|
-
createTestContext(setup);
|
|
304
|
-
|
|
488
|
+
const ctx = createTestContext(setup);
|
|
489
|
+
// Set up mock for API calls (skip if no projectId)
|
|
490
|
+
if (ctx.projectId) {
|
|
491
|
+
createTestToken('test-token');
|
|
492
|
+
const data = ctx.mediaLibraries.filter((lib)=>lib.status === 'active');
|
|
493
|
+
mockApi({
|
|
494
|
+
apiVersion: MEDIA_LIBRARY_API_VERSION,
|
|
495
|
+
method: 'get',
|
|
496
|
+
query: {
|
|
497
|
+
projectId: ctx.projectId
|
|
498
|
+
},
|
|
499
|
+
uri: '/media-libraries'
|
|
500
|
+
}).reply(200, {
|
|
501
|
+
data
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
const { error } = await testCommand(MediaExportCommand, args, {
|
|
505
|
+
mocks: ctx.mocks
|
|
506
|
+
});
|
|
305
507
|
expect(error?.message).toContain(errorMessage);
|
|
306
508
|
expect(error?.oclif?.exit).toBe(1);
|
|
307
509
|
if (additionalCheck) {
|
|
@@ -329,40 +531,135 @@ describe('#media:export', ()=>{
|
|
|
329
531
|
}
|
|
330
532
|
}
|
|
331
533
|
])('should pass $description flag correctly', async ({ args, expected })=>{
|
|
332
|
-
|
|
534
|
+
mockApi({
|
|
535
|
+
apiVersion: MEDIA_LIBRARY_API_VERSION,
|
|
536
|
+
method: 'get',
|
|
537
|
+
query: {
|
|
538
|
+
projectId: TEST_CONFIG.PROJECT_ID
|
|
539
|
+
},
|
|
540
|
+
uri: '/media-libraries'
|
|
541
|
+
}).reply(200, {
|
|
542
|
+
data: [
|
|
543
|
+
{
|
|
544
|
+
id: 'test-media-library',
|
|
545
|
+
organizationId: 'org-1',
|
|
546
|
+
status: 'active'
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
id: 'another-library',
|
|
550
|
+
organizationId: 'org-1',
|
|
551
|
+
status: 'active'
|
|
552
|
+
}
|
|
553
|
+
]
|
|
554
|
+
});
|
|
555
|
+
createTestToken('test-token');
|
|
556
|
+
const ctx = createTestContext({
|
|
333
557
|
selectValue: TEST_CONFIG.MEDIA_LIBRARY_ID
|
|
334
558
|
});
|
|
335
559
|
await testCommand(MediaExportCommand, [
|
|
336
560
|
TEST_OUTPUTS.TAR_GZ,
|
|
337
561
|
...args
|
|
338
|
-
]
|
|
562
|
+
], {
|
|
563
|
+
mocks: ctx.mocks
|
|
564
|
+
});
|
|
339
565
|
expect(mockExportDataset).toHaveBeenCalledWith(expect.objectContaining(expected));
|
|
340
566
|
});
|
|
341
567
|
test('should handle export failure', async ()=>{
|
|
342
|
-
|
|
568
|
+
mockApi({
|
|
569
|
+
apiVersion: MEDIA_LIBRARY_API_VERSION,
|
|
570
|
+
method: 'get',
|
|
571
|
+
query: {
|
|
572
|
+
projectId: TEST_CONFIG.PROJECT_ID
|
|
573
|
+
},
|
|
574
|
+
uri: '/media-libraries'
|
|
575
|
+
}).reply(200, {
|
|
576
|
+
data: [
|
|
577
|
+
{
|
|
578
|
+
id: 'test-media-library',
|
|
579
|
+
organizationId: 'org-1',
|
|
580
|
+
status: 'active'
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
id: 'another-library',
|
|
584
|
+
organizationId: 'org-1',
|
|
585
|
+
status: 'active'
|
|
586
|
+
}
|
|
587
|
+
]
|
|
588
|
+
});
|
|
589
|
+
createTestToken('test-token');
|
|
590
|
+
const ctx = createTestContext({
|
|
343
591
|
selectValue: TEST_CONFIG.MEDIA_LIBRARY_ID
|
|
344
592
|
});
|
|
345
593
|
mockExportDataset.mockRejectedValueOnce(new Error('Export operation failed'));
|
|
346
594
|
const { error } = await testCommand(MediaExportCommand, [
|
|
347
595
|
TEST_OUTPUTS.TAR_GZ
|
|
348
|
-
]
|
|
596
|
+
], {
|
|
597
|
+
mocks: ctx.mocks
|
|
598
|
+
});
|
|
349
599
|
expect(error?.message).toContain(ERROR_MESSAGES.EXPORT_FAILED);
|
|
350
600
|
expect(error?.message).toContain('Export operation failed');
|
|
351
601
|
expect(error?.oclif?.exit).toBe(1);
|
|
352
602
|
});
|
|
353
603
|
test('should create subdirectories if they do not exist', async ()=>{
|
|
354
|
-
|
|
604
|
+
mockApi({
|
|
605
|
+
apiVersion: MEDIA_LIBRARY_API_VERSION,
|
|
606
|
+
method: 'get',
|
|
607
|
+
query: {
|
|
608
|
+
projectId: TEST_CONFIG.PROJECT_ID
|
|
609
|
+
},
|
|
610
|
+
uri: '/media-libraries'
|
|
611
|
+
}).reply(200, {
|
|
612
|
+
data: [
|
|
613
|
+
{
|
|
614
|
+
id: 'test-media-library',
|
|
615
|
+
organizationId: 'org-1',
|
|
616
|
+
status: 'active'
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
id: 'another-library',
|
|
620
|
+
organizationId: 'org-1',
|
|
621
|
+
status: 'active'
|
|
622
|
+
}
|
|
623
|
+
]
|
|
624
|
+
});
|
|
625
|
+
createTestToken('test-token');
|
|
626
|
+
const ctx = createTestContext({
|
|
355
627
|
selectValue: TEST_CONFIG.MEDIA_LIBRARY_ID
|
|
356
628
|
});
|
|
357
629
|
await testCommand(MediaExportCommand, [
|
|
358
630
|
TEST_OUTPUTS.SUBDIR
|
|
359
|
-
]
|
|
631
|
+
], {
|
|
632
|
+
mocks: ctx.mocks
|
|
633
|
+
});
|
|
360
634
|
expect(mockFs.mkdir).toHaveBeenCalledWith(expect.stringContaining('subdir'), expect.objectContaining({
|
|
361
635
|
recursive: true
|
|
362
636
|
}));
|
|
363
637
|
});
|
|
364
638
|
test('should filter inactive media libraries', async ()=>{
|
|
365
|
-
|
|
639
|
+
// Set up custom mock for this test with both active and inactive libraries
|
|
640
|
+
mockApi({
|
|
641
|
+
apiVersion: MEDIA_LIBRARY_API_VERSION,
|
|
642
|
+
method: 'get',
|
|
643
|
+
query: {
|
|
644
|
+
projectId: TEST_CONFIG.PROJECT_ID
|
|
645
|
+
},
|
|
646
|
+
uri: '/media-libraries'
|
|
647
|
+
}).reply(200, {
|
|
648
|
+
data: [
|
|
649
|
+
{
|
|
650
|
+
id: 'active-library',
|
|
651
|
+
organizationId: 'org-1',
|
|
652
|
+
status: 'active'
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
id: 'inactive-library',
|
|
656
|
+
organizationId: 'org-1',
|
|
657
|
+
status: 'inactive'
|
|
658
|
+
}
|
|
659
|
+
]
|
|
660
|
+
});
|
|
661
|
+
createTestToken('test-token');
|
|
662
|
+
const ctx = createTestContext({
|
|
366
663
|
mediaLibraries: [
|
|
367
664
|
{
|
|
368
665
|
id: 'active-library',
|
|
@@ -379,7 +676,9 @@ describe('#media:export', ()=>{
|
|
|
379
676
|
});
|
|
380
677
|
await testCommand(MediaExportCommand, [
|
|
381
678
|
TEST_OUTPUTS.TAR_GZ
|
|
382
|
-
]
|
|
679
|
+
], {
|
|
680
|
+
mocks: ctx.mocks
|
|
681
|
+
});
|
|
383
682
|
expect(mockSelect).toHaveBeenCalledWith(expect.objectContaining({
|
|
384
683
|
choices: expect.arrayContaining([
|
|
385
684
|
expect.objectContaining({
|