Skip to content

Commit 6dae4be

Browse files
Testing
1 parent bec6793 commit 6dae4be

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

arduino-ide-extension/src/node/config-service-impl.ts

+11-4
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export class ConfigServiceImpl
216216
}
217217

218218
private async getFallbackCliConfig(): Promise<DefaultCliConfig> {
219+
console.log('TEST getting fallbackc config');
219220
const cliPath = this.daemon.getExecPath();
220221
const [configRaw, directoriesRaw] = await Promise.all([
221222
spawnCommand(cliPath, ['config', 'dump', '--json']),
@@ -224,10 +225,16 @@ export class ConfigServiceImpl
224225
spawnCommand(cliPath, ['config', 'get', 'directories', '--json']),
225226
]);
226227

227-
const config = JSON.parse(configRaw);
228-
const { user, data } = JSON.parse(directoriesRaw);
229-
230-
return { ...config.config, directories: { user, data } };
228+
console.log('TEST cli config result', configRaw, directoriesRaw);
229+
try {
230+
const config = JSON.parse(configRaw);
231+
const { user, data } = JSON.parse(directoriesRaw ?? '{}');
232+
return { ...config.config, directories: { user, data } };
233+
} catch (error) {
234+
throw new Error(
235+
`TEST Failed to parse the CLI configuration: ${configRaw} ||| ${directoriesRaw}`
236+
);
237+
}
231238
}
232239

233240
private async initCliConfigTo(fsPathToDir: string): Promise<void> {

arduino-ide-extension/src/test/node/clang-formatter.test.ts

+5
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,15 @@ describe('clang-formatter', () => {
103103
toDispose = new DisposableCollection(
104104
Disposable.create(() => tracked.cleanupSync())
105105
);
106+
console.log('TEST creating container...');
106107
const container = await createBaseContainer({
107108
additionalBindings: (bind) =>
108109
bind(ClangFormatter).toSelf().inSingletonScope(),
109110
});
111+
console.log('TEST starting daemon...');
110112
await startDaemon(container, toDispose);
111113
formatter = container.get<ClangFormatter>(ClangFormatter);
114+
console.log('TEST before all complete...');
112115
});
113116

114117
after(() => toDispose.dispose());
@@ -122,7 +125,9 @@ describe('clang-formatter', () => {
122125
it(`should execute the formatter with a single ${
123126
Array.isArray(value) ? 'array' : typeof value
124127
} type style configuration value: ${styleArg}`, async () => {
128+
console.log('TEST single line formatter...');
125129
await expectNoChanges(formatter, styleArg);
130+
console.log('TEST finish single line formatter...');
126131
})
127132
);
128133

0 commit comments

Comments
 (0)