Skip to content

Commit

Permalink
fix: stricter assertion for optional programmer
Browse files Browse the repository at this point in the history
Signed-off-by: Akos Kitta <[email protected]>
  • Loading branch information
Akos Kitta committed Feb 16, 2024
1 parent 53ab133 commit 6f496c5
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions arduino-ide-extension/src/test/browser/debug.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,23 @@ describe('debug', () => {
);
});

it('should resolve when no programmer is selected (arduino/arduino-cli#2540)', async () => {
const copyData: Mutable<BoardsDataStore.Data> = deepClone(data);
delete copyData.selectedProgrammer;
await doesNotReject(
isDebugEnabled(
board,
() => boardDetails,
() => copyData,
(fqbn) => fqbn,
async (params) => {
expect(params.programmer).to.be.undefined;
return params.fqbn;
}
)
);
});

it('should error when it fails to get the debug info from the CLI', async () => {
await rejects(
isDebugEnabled(
Expand All @@ -133,20 +150,6 @@ describe('debug', () => {
);
});

it('should resolve when no programmer is selected (arduino/arduino-cli#2540)', async () => {
const copyData: Mutable<BoardsDataStore.Data> = deepClone(data);
delete copyData.selectedProgrammer;
await doesNotReject(
isDebugEnabled(
board,
() => boardDetails,
() => copyData,
(fqbn) => fqbn,
async () => fqbn
)
);
});

it('should resolve when debugging is supported', async () => {
await doesNotReject(
isDebugEnabled(
Expand Down

0 comments on commit 6f496c5

Please sign in to comment.