forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelpers.test.ts
More file actions
21 lines (16 loc) · 787 Bytes
/
helpers.test.ts
File metadata and controls
21 lines (16 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as assert from 'assert';
// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
import { isNotInstalledError } from '../../client/common/helpers';
// Defines a Mocha test suite to group tests of similar kind together
suite('helpers', () => {
test('isNotInstalledError', (done) => {
const error = new Error('something is not installed');
assert.strictEqual(isNotInstalledError(error), false, 'Standard error');
(error as any).code = 'ENOENT';
assert.strictEqual(isNotInstalledError(error), true, 'ENOENT error code not detected');
(error as any).code = 127;
assert.strictEqual(isNotInstalledError(error), true, '127 error code not detected');
done();
});
});