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
24 lines (22 loc) · 839 Bytes
/
Copy pathprocess.ts
File metadata and controls
24 lines (22 loc) · 839 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
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;
}
}