forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.ts
More file actions
29 lines (26 loc) · 916 Bytes
/
process.ts
File metadata and controls
29 lines (26 loc) · 916 Bytes
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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { injectable } from 'inversify';
import * as TypeMoq from 'typemoq';
import { ICurrentProcess } from '../../client/common/types';
import { EnvironmentVariables } from '../../client/common/variables/types';
@injectable()
export class MockProcess implements ICurrentProcess {
constructor(public env: EnvironmentVariables = { ...process.env }) { }
public on(event: string | symbol, listener: Function): this {
return this;
}
public get argv(): string[] {
return [];
}
public get stdout(): NodeJS.WriteStream {
return TypeMoq.Mock.ofType<NodeJS.WriteStream>().object;
}
public get stdin(): NodeJS.ReadStream {
return TypeMoq.Mock.ofType<NodeJS.ReadStream>().object;
}
public get execPath() : string {
return '';
}
}