jest-watcher

  • Version 27.2.5
  • Published
  • 26.7 kB
  • 7 dependencies
  • MIT license

Install

npm i jest-watcher
yarn add jest-watcher
pnpm add jest-watcher

Overview

Delightful JavaScript Testing.

Index

Variables

variable KEYS

const KEYS: {
ARROW_DOWN: string;
ARROW_LEFT: string;
ARROW_RIGHT: string;
ARROW_UP: string;
BACKSPACE: string;
CONTROL_C: string;
CONTROL_D: string;
CONTROL_U: string;
ENTER: string;
ESCAPE: string;
};
  • Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.

    This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Functions

function printPatternCaret

printPatternCaret: (pattern: string, pipe: any) => void;
  • Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.

    This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

function printRestoredPatternCaret

printRestoredPatternCaret: (
pattern: string,
currentUsageRows: number,
pipe: any
) => void;

    Classes

    class BaseWatchPlugin

    abstract class BaseWatchPlugin implements WatchPlugin {}

      constructor

      constructor({ stdin, stdout }: { stdin: any; stdout: any });

        method apply

        apply: (_hooks: JestHookSubscriber) => void;

          method getUsageInfo

          getUsageInfo: (_globalConfig: any) => UsageData | null;

            method onKey

            onKey: (_key: string) => void;

              method run

              run: (
              _globalConfig: any,
              _updateConfigAndRun: UpdateConfigCallback
              ) => Promise<void | boolean>;

                class JestHook

                class JestHooks {}

                  constructor

                  constructor();

                    method getEmitter

                    getEmitter: () => Readonly<JestHookEmitter>;

                      method getSubscriber

                      getSubscriber: () => Readonly<JestHookSubscriber>;

                        method isUsed

                        isUsed: (hook: AvailableHooks) => boolean;

                          class PatternPrompt

                          class PatternPrompt {}

                            constructor

                            constructor(pipe: any, prompt: Prompt);

                              method run

                              run: (
                              onSuccess: (value: string) => void,
                              onCancel: () => void,
                              options?: { header: string }
                              ) => void;

                                class Prompt

                                class Prompt {}

                                  constructor

                                  constructor();

                                    method abort

                                    abort: () => void;

                                      method enter

                                      enter: (
                                      onChange: (pattern: string, options: ScrollOptions) => void,
                                      onSuccess: (pattern: string) => void,
                                      onCancel: () => void
                                      ) => void;

                                        method isEntering

                                        isEntering: () => boolean;

                                          method put

                                          put: (key: string) => void;

                                            method setPromptLength

                                            setPromptLength: (length: number) => void;

                                              method setPromptSelection

                                              setPromptSelection: (selected: string) => void;

                                                Interfaces

                                                interface WatchPlugin

                                                interface WatchPlugin {}

                                                  property apply

                                                  apply?: (hooks: JestHookSubscriber) => void;

                                                    property getUsageInfo

                                                    getUsageInfo?: (globalConfig: Config.GlobalConfig) => UsageData | null;

                                                      property isInternal

                                                      isInternal?: boolean;

                                                        property onKey

                                                        onKey?: (value: string) => void;

                                                          property run

                                                          run?: (
                                                          globalConfig: Config.GlobalConfig,
                                                          updateConfigAndRun: UpdateConfigCallback
                                                          ) => Promise<void | boolean>;

                                                            interface WatchPluginClass

                                                            interface WatchPluginClass {}

                                                              construct signature

                                                              new (options: {
                                                              config: Record<string, unknown>;
                                                              stdin: NodeJS.ReadStream;
                                                              stdout: NodeJS.WriteStream;
                                                              }): WatchPlugin;

                                                                Type Aliases

                                                                type AllowedConfigOptions

                                                                type AllowedConfigOptions = Partial<
                                                                Pick<
                                                                Config.GlobalConfig,
                                                                | 'bail'
                                                                | 'changedSince'
                                                                | 'collectCoverage'
                                                                | 'collectCoverageFrom'
                                                                | 'collectCoverageOnlyFrom'
                                                                | 'coverageDirectory'
                                                                | 'coverageReporters'
                                                                | 'findRelatedTests'
                                                                | 'nonFlagArgs'
                                                                | 'notify'
                                                                | 'notifyMode'
                                                                | 'onlyFailures'
                                                                | 'reporters'
                                                                | 'testNamePattern'
                                                                | 'testPathPattern'
                                                                | 'updateSnapshot'
                                                                | 'verbose'
                                                                > & {
                                                                mode: 'watch' | 'watchAll';
                                                                }
                                                                >;

                                                                  type JestHookEmitter

                                                                  type JestHookEmitter = {
                                                                  onFileChange: (fs: JestHookExposedFS) => void;
                                                                  onTestRunComplete: (results: AggregatedResult) => void;
                                                                  shouldRunTestSuite: (testSuiteInfo: TestSuiteInfo) => Promise<boolean> | boolean;
                                                                  };

                                                                    type JestHookSubscriber

                                                                    type JestHookSubscriber = {
                                                                    onFileChange: (fn: FileChange) => void;
                                                                    onTestRunComplete: (fn: TestRunComplete) => void;
                                                                    shouldRunTestSuite: (fn: ShouldRunTestSuite) => void;
                                                                    };

                                                                      type ScrollOptions

                                                                      type ScrollOptions = {
                                                                      offset: number;
                                                                      max: number;
                                                                      };

                                                                        type UpdateConfigCallback

                                                                        type UpdateConfigCallback = (config?: AllowedConfigOptions) => void;

                                                                          type UsageData

                                                                          type UsageData = {
                                                                          key: string;
                                                                          prompt: string;
                                                                          };

                                                                            Package Files (8)

                                                                            Dependencies (7)

                                                                            Dev Dependencies (0)

                                                                            No dev dependencies.

                                                                            Peer Dependencies (0)

                                                                            No peer dependencies.

                                                                            Badge

                                                                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/jest-watcher.

                                                                            • Markdown
                                                                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/jest-watcher)
                                                                            • HTML
                                                                              <a href="https://www.jsdocs.io/package/jest-watcher"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>