mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 05:51:32 +01:00
api tests for links
This commit is contained in:
@@ -12,9 +12,9 @@ export function rndName() {
|
||||
return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 10);
|
||||
}
|
||||
|
||||
export function createRandomFile(contents = '', dir: string = os.tmpdir()): Thenable<vscode.Uri> {
|
||||
export function createRandomFile(contents = '', dir: string = os.tmpdir(), ext = ''): Thenable<vscode.Uri> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const tmpFile = join(dir, rndName());
|
||||
const tmpFile = join(dir, rndName() + ext);
|
||||
fs.writeFile(tmpFile, contents, (error) => {
|
||||
if (error) {
|
||||
return reject(error);
|
||||
|
||||
Reference in New Issue
Block a user