microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0.4.1

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/test/resources/simulators/childProcess.ts

46lines · modeblame

efebb488digeff10 years ago1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4import * as stream from "stream";
5import * as events from "events";
6import * as child_process from "child_process";
7
8class Stream extends events.EventEmitter {
9// The methods we get from events.EventEmitter seems to be enough for what we need
10}
11
12/* ChildProcess can emit events to simulate the behavior of a real child process from the
13spawneer/caller point of view */
14export class ChildProcess extends events.EventEmitter implements child_process.ChildProcess {
15public stdin: stream.Writable = <stream.Writable>new Stream();
16public stdout: stream.Readable = <stream.Readable>new Stream();
17public stderr: stream.Readable = <stream.Readable>new Stream();
18public pid: number; // Not yet implemented
6d5c8798Nikita Matrosov9 years ago19public connected: boolean;
81f88231Patricio Beltran9 years ago20public stdio: [stream.Writable, stream.Readable, stream.Readable]; // Not yet implemented
efebb488digeff10 years ago21
22public kill(signal?: string): void {
23this.notYetImplemented();
24}
25
6d5c8798Nikita Matrosov9 years ago26public send(message: any, sendHandle?: any): boolean {
efebb488digeff10 years ago27this.notYetImplemented();
6d5c8798Nikita Matrosov9 years ago28return false;
efebb488digeff10 years ago29}
30
31public disconnect(): void {
32this.notYetImplemented();
33}
34
35public unref(): void {
36this.notYetImplemented();
37}
38
6d5c8798Nikita Matrosov9 years ago39public ref(): void {
40this.notYetImplemented();
41}
42
efebb488digeff10 years ago43private notYetImplemented(): void { // We'll implement these methods if we ever need them
44throw new Error("This method of class ChildProcess has not yet been implemented.");
45}
46}