forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelpers.test.ts
More file actions
23 lines (18 loc) · 853 Bytes
/
helpers.test.ts
File metadata and controls
23 lines (18 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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.equal(isNotInstalledError(error), false, 'Standard error');
// tslint:disable-next-line:no-any
(error as any).code = 'ENOENT';
assert.equal(isNotInstalledError(error), true, 'ENOENT error code not detected');
// tslint:disable-next-line:no-any
(error as any).code = 127;
assert.equal(isNotInstalledError(error), true, '127 error code not detected');
done();
});
});