Skip to content

IDE to run CLI with auto assigned port #673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 9, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions arduino-ide-extension/src/test/node/arduino-daemon-impl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,22 @@ describe('arduino-daemon-impl', () => {
// });

it('should parse the port address when the log format is json', async () => {
const instance = await new SilentArduinoDaemonImpl(
const { daemon, port } = await new SilentArduinoDaemonImpl(
'json'
).spawnDaemonProcess();
expect(instance.port).not.to.be.undefined;
expect(instance.port).not.to.be.equal('0');

expect(port).not.to.be.undefined;
expect(port).not.to.be.equal('0');
daemon.kill();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'd prefer to put the new SilentArduinoDaemonImpl('json').spawnDaemonProcess(); in the beforeEach and the daemon.kill() in the afterEach.
@fstasi does it make sense to you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we actually run the SilentArduinoDaemonImpl with different input: json or text.. we can make a wrapper function probably

});

it('should parse the port address when the log format is text', async () => {
const instance = await new SilentArduinoDaemonImpl(
const { daemon, port } = await new SilentArduinoDaemonImpl(
'text'
).spawnDaemonProcess();
expect(instance.port).not.to.be.undefined;
expect(instance.port).not.to.be.equal('0');

expect(port).not.to.be.undefined;
expect(port).not.to.be.equal('0');
daemon.kill();
});
});