-
-
Notifications
You must be signed in to change notification settings - Fork 435
/
Copy pathexec-util.test.ts
33 lines (28 loc) · 1.04 KB
/
exec-util.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import * as os from 'os';
import { expect, use } from 'chai';
import { getExecPath } from '../../node/exec-util';
use(require('chai-string'));
describe('getExecPath', () => {
it('should resolve arduino-cli', async () => {
const actual = await getExecPath('arduino-cli', onError, 'version');
const expected =
os.platform() === 'win32' ? '\\arduino-cli.exe' : '/arduino-cli';
expect(actual).to.endsWith(expected);
});
it('should resolve arduino-language-server', async () => {
const actual = await getExecPath('arduino-language-server');
const expected =
os.platform() === 'win32'
? '\\arduino-language-server.exe'
: '/arduino-language-server';
expect(actual).to.endsWith(expected);
});
it('should resolve clangd', async () => {
const actual = await getExecPath('clangd', onError, '--version');
const expected = os.platform() === 'win32' ? '\\clangd.exe' : '/clangd';
expect(actual).to.endsWith(expected);
});
function onError(error: Error): void {
console.error(error);
}
});