-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathtestutil.ts
30 lines (26 loc) · 896 Bytes
/
testutil.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
/* --------------------------------------------------------------------------------------------
* SonarLint for VisualStudio Code
* Copyright (C) 2017-2025 SonarSource SA
* Licensed under the LGPLv3 License. See LICENSE.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { Context } from 'mocha';
import * as util from '../src/util/util';
export function sleep(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export function skipTestOnWindowsVm(testContext: Context, reason: string) {
if (util.isRunningOnWindows() && util.isRunningAutoBuild()) {
console.log(reason);
testContext.skip();
}
}
export function getWorkspaceFolder() {
return {
uri: {
path: '/path1'
},
name: 'Name1',
index: 0
};
}