Skip to content

Commit 7aa0939

Browse files
committed
test: added tests for task spawning
1 parent 4b6defd commit 7aa0939

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/tools.test.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import * as assert from 'assert';
2+
import { shellTask } from '../src/lib/tools';
3+
4+
suite('Tools tests', () => {
5+
test('shellTask returns correct output', async () => {
6+
const name = 'pip: fortls';
7+
const output = await shellTask(
8+
'python3',
9+
['-m', 'pip', 'install', '--upgrade', '--force', 'fortls'],
10+
name
11+
);
12+
assert.strictEqual(output, `${name}: shell task completed successfully.`);
13+
});
14+
15+
test('shellTask returns rejected promise', async () => {
16+
const name = 'pip: fortls';
17+
assert.rejects(shellTask('python3', ['-m', 'pip', 'install', 'fortls2'], name));
18+
});
19+
});

0 commit comments

Comments
 (0)