@lightdash/cli 2.228.1 → 2.229.0
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/.tsbuildinfo.build +1 -0
- package/package.json +4 -4
- package/dist/.tsbuildinfo +0 -1
- package/dist/config.test.d.ts +0 -2
- package/dist/config.test.d.ts.map +0 -1
- package/dist/config.test.js +0 -72
- package/dist/dbt/context.test.d.ts +0 -2
- package/dist/dbt/context.test.d.ts.map +0 -1
- package/dist/dbt/context.test.js +0 -152
- package/dist/dbt/manifest.test.d.ts +0 -2
- package/dist/dbt/manifest.test.d.ts.map +0 -1
- package/dist/dbt/manifest.test.js +0 -170
- package/dist/dbt/models.test.d.ts +0 -2
- package/dist/dbt/models.test.d.ts.map +0 -1
- package/dist/dbt/models.test.js +0 -139
- package/dist/dbt/profiles.test.d.ts +0 -2
- package/dist/dbt/profiles.test.d.ts.map +0 -1
- package/dist/dbt/profiles.test.js +0 -50
- package/dist/dbt/targets/athena.test.d.ts +0 -2
- package/dist/dbt/targets/athena.test.d.ts.map +0 -1
- package/dist/dbt/targets/athena.test.js +0 -78
- package/dist/dbt/targets/duckdb.test.d.ts +0 -2
- package/dist/dbt/targets/duckdb.test.d.ts.map +0 -1
- package/dist/dbt/targets/duckdb.test.js +0 -149
- package/dist/dbt/targets/redshift.test.d.ts +0 -2
- package/dist/dbt/targets/redshift.test.d.ts.map +0 -1
- package/dist/dbt/targets/redshift.test.js +0 -198
- package/dist/dbt/templating.test.d.ts +0 -2
- package/dist/dbt/templating.test.d.ts.map +0 -1
- package/dist/dbt/templating.test.js +0 -51
- package/dist/dbt/validation.test.d.ts +0 -2
- package/dist/dbt/validation.test.d.ts.map +0 -1
- package/dist/dbt/validation.test.js +0 -67
- package/dist/handlers/apps/appCodeFiles.test.d.ts +0 -2
- package/dist/handlers/apps/appCodeFiles.test.d.ts.map +0 -1
- package/dist/handlers/apps/appCodeFiles.test.js +0 -391
- package/dist/handlers/apps/appsDownload.test.d.ts +0 -2
- package/dist/handlers/apps/appsDownload.test.d.ts.map +0 -1
- package/dist/handlers/apps/appsDownload.test.js +0 -639
- package/dist/handlers/apps/build.test.d.ts +0 -2
- package/dist/handlers/apps/build.test.d.ts.map +0 -1
- package/dist/handlers/apps/build.test.js +0 -252
- package/dist/handlers/apps/createApp.test.d.ts +0 -2
- package/dist/handlers/apps/createApp.test.d.ts.map +0 -1
- package/dist/handlers/apps/createApp.test.js +0 -340
- package/dist/handlers/apps/pathContainment.test.d.ts +0 -2
- package/dist/handlers/apps/pathContainment.test.d.ts.map +0 -1
- package/dist/handlers/apps/pathContainment.test.js +0 -66
- package/dist/handlers/apps/preview.test.d.ts +0 -2
- package/dist/handlers/apps/preview.test.d.ts.map +0 -1
- package/dist/handlers/apps/preview.test.js +0 -353
- package/dist/handlers/apps/previewProxy.test.d.ts +0 -2
- package/dist/handlers/apps/previewProxy.test.d.ts.map +0 -1
- package/dist/handlers/apps/previewProxy.test.js +0 -178
- package/dist/handlers/apps/scaffolding.test.d.ts +0 -2
- package/dist/handlers/apps/scaffolding.test.d.ts.map +0 -1
- package/dist/handlers/apps/scaffolding.test.js +0 -151
- package/dist/handlers/apps/uploadRetry.test.d.ts +0 -2
- package/dist/handlers/apps/uploadRetry.test.d.ts.map +0 -1
- package/dist/handlers/apps/uploadRetry.test.js +0 -103
- package/dist/handlers/apps/validate.test.d.ts +0 -2
- package/dist/handlers/apps/validate.test.d.ts.map +0 -1
- package/dist/handlers/apps/validate.test.js +0 -526
- package/dist/handlers/compile.test.d.ts +0 -2
- package/dist/handlers/compile.test.d.ts.map +0 -1
- package/dist/handlers/compile.test.js +0 -151
- package/dist/handlers/compileProject.test.d.ts +0 -2
- package/dist/handlers/compileProject.test.d.ts.map +0 -1
- package/dist/handlers/compileProject.test.js +0 -637
- package/dist/handlers/compileWarehouseColumnValidation.test.d.ts +0 -2
- package/dist/handlers/compileWarehouseColumnValidation.test.d.ts.map +0 -1
- package/dist/handlers/compileWarehouseColumnValidation.test.js +0 -493
- package/dist/handlers/connectSnowflake.test.d.ts +0 -2
- package/dist/handlers/connectSnowflake.test.d.ts.map +0 -1
- package/dist/handlers/connectSnowflake.test.js +0 -320
- package/dist/handlers/contentAsCode/fileNames.test.d.ts +0 -2
- package/dist/handlers/contentAsCode/fileNames.test.d.ts.map +0 -1
- package/dist/handlers/contentAsCode/fileNames.test.js +0 -79
- package/dist/handlers/contentAsCode/registry.test.d.ts +0 -2
- package/dist/handlers/contentAsCode/registry.test.d.ts.map +0 -1
- package/dist/handlers/contentAsCode/registry.test.js +0 -18
- package/dist/handlers/contentAsCode/resource.test.d.ts +0 -2
- package/dist/handlers/contentAsCode/resource.test.d.ts.map +0 -1
- package/dist/handlers/contentAsCode/resource.test.js +0 -121
- package/dist/handlers/dbt/getDbtVersion.test.d.ts +0 -2
- package/dist/handlers/dbt/getDbtVersion.test.d.ts.map +0 -1
- package/dist/handlers/dbt/getDbtVersion.test.js +0 -106
- package/dist/handlers/deploy.test.d.ts +0 -2
- package/dist/handlers/deploy.test.d.ts.map +0 -1
- package/dist/handlers/deploy.test.js +0 -244
- package/dist/handlers/download.test.d.ts +0 -2
- package/dist/handlers/download.test.d.ts.map +0 -1
- package/dist/handlers/download.test.js +0 -1739
- package/dist/handlers/exportChartImage.test.d.ts +0 -2
- package/dist/handlers/exportChartImage.test.d.ts.map +0 -1
- package/dist/handlers/exportChartImage.test.js +0 -55
- package/dist/handlers/homepagesAsCode.test.d.ts +0 -2
- package/dist/handlers/homepagesAsCode.test.d.ts.map +0 -1
- package/dist/handlers/homepagesAsCode.test.js +0 -72
- package/dist/handlers/lint.test.d.ts +0 -2
- package/dist/handlers/lint.test.d.ts.map +0 -1
- package/dist/handlers/lint.test.js +0 -221
- package/dist/handlers/login.test.d.ts +0 -2
- package/dist/handlers/login.test.d.ts.map +0 -1
- package/dist/handlers/login.test.js +0 -24
- package/dist/handlers/metadataFile.test.d.ts +0 -2
- package/dist/handlers/metadataFile.test.d.ts.map +0 -1
- package/dist/handlers/metadataFile.test.js +0 -46
- package/dist/handlers/organizationContent/customRoles.test.d.ts +0 -2
- package/dist/handlers/organizationContent/customRoles.test.d.ts.map +0 -1
- package/dist/handlers/organizationContent/customRoles.test.js +0 -179
- package/dist/handlers/organizationContent/groups.test.d.ts +0 -2
- package/dist/handlers/organizationContent/groups.test.d.ts.map +0 -1
- package/dist/handlers/organizationContent/groups.test.js +0 -135
- package/dist/handlers/organizationContent/index.test.d.ts +0 -2
- package/dist/handlers/organizationContent/index.test.d.ts.map +0 -1
- package/dist/handlers/organizationContent/index.test.js +0 -212
- package/dist/handlers/organizationContent/themes.test.d.ts +0 -2
- package/dist/handlers/organizationContent/themes.test.d.ts.map +0 -1
- package/dist/handlers/organizationContent/themes.test.js +0 -180
- package/dist/handlers/organizationContent/users.test.d.ts +0 -2
- package/dist/handlers/organizationContent/users.test.d.ts.map +0 -1
- package/dist/handlers/organizationContent/users.test.js +0 -155
- package/dist/handlers/preAggregateAudit.test.d.ts +0 -2
- package/dist/handlers/preAggregateAudit.test.d.ts.map +0 -1
- package/dist/handlers/preAggregateAudit.test.js +0 -102
- package/dist/handlers/renameHandler.test.d.ts +0 -2
- package/dist/handlers/renameHandler.test.d.ts.map +0 -1
- package/dist/handlers/renameHandler.test.js +0 -189
- package/dist/handlers/resolveProjectFlag.test.d.ts +0 -2
- package/dist/handlers/resolveProjectFlag.test.d.ts.map +0 -1
- package/dist/handlers/resolveProjectFlag.test.js +0 -48
- package/dist/handlers/selectProject.test.d.ts +0 -2
- package/dist/handlers/selectProject.test.d.ts.map +0 -1
- package/dist/handlers/selectProject.test.js +0 -224
- package/dist/handlers/setProject.test.d.ts +0 -2
- package/dist/handlers/setProject.test.d.ts.map +0 -1
- package/dist/handlers/setProject.test.js +0 -63
- package/dist/handlers/slugUpdate.test.d.ts +0 -2
- package/dist/handlers/slugUpdate.test.d.ts.map +0 -1
- package/dist/handlers/slugUpdate.test.js +0 -265
- package/dist/handlers/timestampConversion.test.d.ts +0 -2
- package/dist/handlers/timestampConversion.test.d.ts.map +0 -1
- package/dist/handlers/timestampConversion.test.js +0 -87
- package/dist/handlers/upgradeCheck.test.d.ts +0 -2
- package/dist/handlers/upgradeCheck.test.d.ts.map +0 -1
- package/dist/handlers/upgradeCheck.test.js +0 -227
- package/dist/handlers/validate.test.d.ts +0 -2
- package/dist/handlers/validate.test.d.ts.map +0 -1
- package/dist/handlers/validate.test.js +0 -318
- package/dist/handlers/validateSpaceFilter.test.d.ts +0 -2
- package/dist/handlers/validateSpaceFilter.test.d.ts.map +0 -1
- package/dist/handlers/validateSpaceFilter.test.js +0 -79
- package/dist/handlers/warehouseConnection.test.d.ts +0 -2
- package/dist/handlers/warehouseConnection.test.d.ts.map +0 -1
- package/dist/handlers/warehouseConnection.test.js +0 -75
- package/dist/lightdash-config/lightdash-config.test.d.ts +0 -2
- package/dist/lightdash-config/lightdash-config.test.d.ts.map +0 -1
- package/dist/lightdash-config/lightdash-config.test.js +0 -69
- package/dist/prompts/fuzzySearchPrompt.test.d.ts +0 -2
- package/dist/prompts/fuzzySearchPrompt.test.d.ts.map +0 -1
- package/dist/prompts/fuzzySearchPrompt.test.js +0 -53
- package/dist/refsArgument.test.d.ts +0 -2
- package/dist/refsArgument.test.d.ts.map +0 -1
- package/dist/refsArgument.test.js +0 -42
- package/dist/releaseSafety/index.test.d.ts +0 -2
- package/dist/releaseSafety/index.test.d.ts.map +0 -1
- package/dist/releaseSafety/index.test.js +0 -154
- package/dist/releaseSafety/version.test.d.ts +0 -2
- package/dist/releaseSafety/version.test.d.ts.map +0 -1
- package/dist/releaseSafety/version.test.js +0 -22
- package/dist/skills.test.d.ts +0 -2
- package/dist/skills.test.d.ts.map +0 -1
- package/dist/skills.test.js +0 -112
- package/dist/terminal/contentAsCodeOutput.test.d.ts +0 -2
- package/dist/terminal/contentAsCodeOutput.test.d.ts.map +0 -1
- package/dist/terminal/contentAsCodeOutput.test.js +0 -231
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const globalState_1 = tslib_1.__importDefault(require("../globalState"));
|
|
5
|
-
const contentAsCodeOutput_1 = require("./contentAsCodeOutput");
|
|
6
|
-
describe('content as code terminal output', () => {
|
|
7
|
-
it('formats fallback actions with aligned labels and muted metadata', () => {
|
|
8
|
-
const output = (0, contentAsCodeOutput_1.formatContentAsCodeAction)({
|
|
9
|
-
label: 'Custom roles',
|
|
10
|
-
detail: '34 downloaded',
|
|
11
|
-
durationMs: 245,
|
|
12
|
-
});
|
|
13
|
-
expect(output).toContain('Custom roles 34 downloaded (245ms)');
|
|
14
|
-
});
|
|
15
|
-
it('formats running progress as a tree', () => {
|
|
16
|
-
const output = (0, contentAsCodeOutput_1.formatContentAsCodeProgress)({
|
|
17
|
-
operation: 'download',
|
|
18
|
-
scope: 'organization',
|
|
19
|
-
activeLabel: 'Groups',
|
|
20
|
-
items: [
|
|
21
|
-
{
|
|
22
|
-
label: 'Custom roles',
|
|
23
|
-
detail: '34 downloaded',
|
|
24
|
-
durationMs: 85,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
label: 'Users',
|
|
28
|
-
detail: '9 downloaded',
|
|
29
|
-
durationMs: 107,
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
});
|
|
33
|
-
expect(output).toContain('Downloading content as code (organization)');
|
|
34
|
-
expect(output).toContain('└ ✓ Custom roles · 34 downloaded (85ms)');
|
|
35
|
-
expect(output).toContain('└ ✓ Users · 9 downloaded (107ms)');
|
|
36
|
-
expect(output).toContain('└ ◐ Groups · downloading…');
|
|
37
|
-
});
|
|
38
|
-
it('renders one borderless completion tree', () => {
|
|
39
|
-
const output = (0, contentAsCodeOutput_1.formatContentAsCodeComplete)({
|
|
40
|
-
operation: 'upload',
|
|
41
|
-
scope: 'organization',
|
|
42
|
-
path: '/tmp/lightdash',
|
|
43
|
-
elapsedSeconds: 1.2,
|
|
44
|
-
items: [
|
|
45
|
-
{
|
|
46
|
-
label: 'Custom roles',
|
|
47
|
-
detail: '1 created, 2 unchanged',
|
|
48
|
-
durationMs: 245,
|
|
49
|
-
},
|
|
50
|
-
{ label: 'Users', detail: '4 updated', durationMs: 31 },
|
|
51
|
-
{
|
|
52
|
-
label: 'Groups',
|
|
53
|
-
detail: 'service unavailable',
|
|
54
|
-
durationMs: 12,
|
|
55
|
-
variant: 'warning',
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
});
|
|
59
|
-
expect(output).toContain('✓ Uploaded content as code (organization) · 1.2s');
|
|
60
|
-
expect(output).toContain('└ ✓ Custom roles');
|
|
61
|
-
expect(output).toContain('(245ms)');
|
|
62
|
-
expect(output).toContain('└ ⚠ Groups');
|
|
63
|
-
expect(output).toContain('└ Read from /tmp/lightdash');
|
|
64
|
-
expect(output).not.toMatch(/[╭╮╰╯│─]/);
|
|
65
|
-
});
|
|
66
|
-
it('formats failures with completed and failed tree rows', () => {
|
|
67
|
-
const output = (0, contentAsCodeOutput_1.formatContentAsCodeFailure)({
|
|
68
|
-
operation: 'download',
|
|
69
|
-
scope: 'organization',
|
|
70
|
-
elapsedSeconds: 0.4,
|
|
71
|
-
items: [
|
|
72
|
-
{
|
|
73
|
-
label: 'Custom roles',
|
|
74
|
-
detail: '34 downloaded',
|
|
75
|
-
durationMs: 85,
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
failedItem: {
|
|
79
|
-
label: 'Users',
|
|
80
|
-
detail: '403 forbidden',
|
|
81
|
-
durationMs: 52,
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
expect(output).toContain('Failed to download content as code (organization) · 0.4s');
|
|
85
|
-
expect(output).toContain('└ ✓ Custom roles · 34 downloaded (85ms)');
|
|
86
|
-
expect(output).toContain('└ × Users · 403 forbidden (52ms)');
|
|
87
|
-
});
|
|
88
|
-
it('replaces running progress with one persistent completion tree', () => {
|
|
89
|
-
const originalIsTTY = process.stderr.isTTY;
|
|
90
|
-
Object.defineProperty(process.stderr, 'isTTY', {
|
|
91
|
-
configurable: true,
|
|
92
|
-
value: true,
|
|
93
|
-
});
|
|
94
|
-
vi.stubEnv('CI', 'false');
|
|
95
|
-
vi.stubEnv('TERM', 'xterm');
|
|
96
|
-
vi.stubEnv('NO_UNICODE', 'false');
|
|
97
|
-
const spinner = {
|
|
98
|
-
text: '',
|
|
99
|
-
start: vi.fn(),
|
|
100
|
-
succeed: vi.fn(),
|
|
101
|
-
warn: vi.fn(),
|
|
102
|
-
stop: vi.fn(),
|
|
103
|
-
fail: vi.fn(),
|
|
104
|
-
};
|
|
105
|
-
vi.spyOn(globalState_1.default, 'startSpinner').mockReturnValue(spinner);
|
|
106
|
-
const write = vi
|
|
107
|
-
.spyOn(process.stderr, 'write')
|
|
108
|
-
.mockImplementation(() => true);
|
|
109
|
-
const output = (0, contentAsCodeOutput_1.createContentAsCodeOutput)({
|
|
110
|
-
operation: 'download',
|
|
111
|
-
scope: 'organization',
|
|
112
|
-
});
|
|
113
|
-
output.startItem('Custom roles');
|
|
114
|
-
output.completeItem('34 downloaded');
|
|
115
|
-
output.startItem('Users');
|
|
116
|
-
expect(spinner.succeed).not.toHaveBeenCalled();
|
|
117
|
-
expect(spinner.text).toContain('└ ◐ Users · downloading…');
|
|
118
|
-
expect(output.complete('/tmp/lightdash', 0.6)).toBe(true);
|
|
119
|
-
expect(spinner.stop).toHaveBeenCalledOnce();
|
|
120
|
-
expect(write).toHaveBeenCalledOnce();
|
|
121
|
-
Object.defineProperty(process.stderr, 'isTTY', {
|
|
122
|
-
configurable: true,
|
|
123
|
-
value: originalIsTTY,
|
|
124
|
-
});
|
|
125
|
-
vi.unstubAllEnvs();
|
|
126
|
-
vi.restoreAllMocks();
|
|
127
|
-
});
|
|
128
|
-
it('pauses the spinner around a prompt and resumes with progress text', async () => {
|
|
129
|
-
const originalIsTTY = process.stderr.isTTY;
|
|
130
|
-
Object.defineProperty(process.stderr, 'isTTY', {
|
|
131
|
-
configurable: true,
|
|
132
|
-
value: true,
|
|
133
|
-
});
|
|
134
|
-
vi.stubEnv('CI', 'false');
|
|
135
|
-
vi.stubEnv('TERM', 'xterm');
|
|
136
|
-
vi.stubEnv('NO_UNICODE', 'false');
|
|
137
|
-
const spinner = {
|
|
138
|
-
text: '',
|
|
139
|
-
start: vi.fn(),
|
|
140
|
-
succeed: vi.fn(),
|
|
141
|
-
warn: vi.fn(),
|
|
142
|
-
stop: vi.fn(),
|
|
143
|
-
fail: vi.fn(),
|
|
144
|
-
};
|
|
145
|
-
vi.spyOn(globalState_1.default, 'startSpinner').mockReturnValue(spinner);
|
|
146
|
-
const output = (0, contentAsCodeOutput_1.createContentAsCodeOutput)({
|
|
147
|
-
operation: 'upload',
|
|
148
|
-
scope: 'project',
|
|
149
|
-
});
|
|
150
|
-
output.startItem('Data apps');
|
|
151
|
-
// The spinner must be stopped BEFORE the prompt runs (a spinning
|
|
152
|
-
// repaint hides the prompt and the command looks hung).
|
|
153
|
-
const answer = await output.promptWhilePaused(() => {
|
|
154
|
-
expect(spinner.stop).toHaveBeenCalledOnce();
|
|
155
|
-
expect(spinner.start).not.toHaveBeenCalled();
|
|
156
|
-
return Promise.resolve('yes');
|
|
157
|
-
});
|
|
158
|
-
expect(answer).toBe('yes');
|
|
159
|
-
expect(spinner.start).toHaveBeenCalledOnce();
|
|
160
|
-
expect(String(spinner.start.mock.calls[0][0])).toContain('Data apps');
|
|
161
|
-
// A rejecting prompt still resumes the spinner.
|
|
162
|
-
await expect(output.promptWhilePaused(() => Promise.reject(new Error('nope')))).rejects.toThrow('nope');
|
|
163
|
-
expect(spinner.start).toHaveBeenCalledTimes(2);
|
|
164
|
-
Object.defineProperty(process.stderr, 'isTTY', {
|
|
165
|
-
configurable: true,
|
|
166
|
-
value: originalIsTTY,
|
|
167
|
-
});
|
|
168
|
-
vi.unstubAllEnvs();
|
|
169
|
-
vi.restoreAllMocks();
|
|
170
|
-
});
|
|
171
|
-
it('updates the active tree item with resource progress', () => {
|
|
172
|
-
const originalIsTTY = process.stderr.isTTY;
|
|
173
|
-
Object.defineProperty(process.stderr, 'isTTY', {
|
|
174
|
-
configurable: true,
|
|
175
|
-
value: true,
|
|
176
|
-
});
|
|
177
|
-
vi.stubEnv('CI', 'false');
|
|
178
|
-
vi.stubEnv('TERM', 'xterm');
|
|
179
|
-
vi.stubEnv('NO_UNICODE', 'false');
|
|
180
|
-
const spinner = {
|
|
181
|
-
text: '',
|
|
182
|
-
start: vi.fn(),
|
|
183
|
-
succeed: vi.fn(),
|
|
184
|
-
warn: vi.fn(),
|
|
185
|
-
stop: vi.fn(),
|
|
186
|
-
fail: vi.fn(),
|
|
187
|
-
};
|
|
188
|
-
vi.spyOn(globalState_1.default, 'startSpinner').mockReturnValue(spinner);
|
|
189
|
-
const output = (0, contentAsCodeOutput_1.createContentAsCodeOutput)({
|
|
190
|
-
operation: 'download',
|
|
191
|
-
scope: 'project',
|
|
192
|
-
});
|
|
193
|
-
output.startItem('Charts');
|
|
194
|
-
output.updateActive('25 of 100 downloaded');
|
|
195
|
-
expect(spinner.text).toContain('└ ◐ Charts · 25 of 100 downloaded');
|
|
196
|
-
Object.defineProperty(process.stderr, 'isTTY', {
|
|
197
|
-
configurable: true,
|
|
198
|
-
value: originalIsTTY,
|
|
199
|
-
});
|
|
200
|
-
vi.unstubAllEnvs();
|
|
201
|
-
vi.restoreAllMocks();
|
|
202
|
-
});
|
|
203
|
-
it('hides routine discovery in tree mode unless verbose output is enabled', () => {
|
|
204
|
-
const originalIsTTY = process.stderr.isTTY;
|
|
205
|
-
Object.defineProperty(process.stderr, 'isTTY', {
|
|
206
|
-
configurable: true,
|
|
207
|
-
value: true,
|
|
208
|
-
});
|
|
209
|
-
vi.stubEnv('CI', 'false');
|
|
210
|
-
vi.stubEnv('TERM', 'xterm');
|
|
211
|
-
vi.stubEnv('NO_UNICODE', 'false');
|
|
212
|
-
const debug = vi
|
|
213
|
-
.spyOn(globalState_1.default, 'debug')
|
|
214
|
-
.mockImplementation(() => undefined);
|
|
215
|
-
const log = vi
|
|
216
|
-
.spyOn(globalState_1.default, 'log')
|
|
217
|
-
.mockImplementation(() => undefined);
|
|
218
|
-
(0, contentAsCodeOutput_1.logContentAsCodeDiscovery)('Found 3 chart files');
|
|
219
|
-
expect(debug).toHaveBeenCalledWith('Found 3 chart files');
|
|
220
|
-
expect(log).not.toHaveBeenCalled();
|
|
221
|
-
vi.stubEnv('CI', 'true');
|
|
222
|
-
(0, contentAsCodeOutput_1.logContentAsCodeDiscovery)('Found 3 chart files');
|
|
223
|
-
expect(log).toHaveBeenCalledWith('Found 3 chart files');
|
|
224
|
-
Object.defineProperty(process.stderr, 'isTTY', {
|
|
225
|
-
configurable: true,
|
|
226
|
-
value: originalIsTTY,
|
|
227
|
-
});
|
|
228
|
-
vi.unstubAllEnvs();
|
|
229
|
-
vi.restoreAllMocks();
|
|
230
|
-
});
|
|
231
|
-
});
|