forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.ts
More file actions
39 lines (31 loc) · 1.17 KB
/
process.ts
File metadata and controls
39 lines (31 loc) · 1.17 KB
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
31
32
33
34
35
36
37
38
39
// 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 }) {}
// eslint-disable-next-line @typescript-eslint/ban-types
public on(_event: string | symbol, _listener: Function): this {
return this;
}
// eslint-disable-next-line class-methods-use-this
public get argv(): string[] {
return [];
}
// eslint-disable-next-line class-methods-use-this
public get stdout(): NodeJS.WriteStream {
return TypeMoq.Mock.ofType<NodeJS.WriteStream>().object;
}
// eslint-disable-next-line class-methods-use-this
public get stdin(): NodeJS.ReadStream {
return TypeMoq.Mock.ofType<NodeJS.ReadStream>().object;
}
// eslint-disable-next-line class-methods-use-this
public get execPath(): string {
return '';
}
}