Skip to content

Bug: Spawning Jest on Windows with jest-editor-support < 22.1.3 #274

@seanpoulter

Description

@seanpoulter

Environment

  1. node -v: 8.9.1
  2. npm -v: 5.5.1
  3. npm ls react-scripts (if you haven’t ejected): N/A
  4. Operating system: Windows
  • Jest: 21.2.1

Problem

Our recent changes to the way we spawn Jest on Windows has introduced a regression in projects that aren't using jest-editor-support version ^22.1.3. This presents itself in two ways:

In release 2.6.4:

Jest appears to run propertly, but there is an error in the Developer Tools console:

  ERR spawn node_modules\.bin\jest ENOENT: Error: spawn node_modules\.bin\jest ENOENT
	at exports._errnoException (util.js:1050:11)
	at Process.__dirname.ChildProcess._handle.onexit (internal/child_process.js:193:32)
	at onErrorNT (internal/child_process.js:367:16)
	at _combinedTickCallback (internal/process/next_tick.js:80:11)
	at process._tickCallback (internal/process/next_tick.js:104:9)

When debugging the extension, the first uncaught error shares the same call stack:
image

Debugging the extension from master:

  • Jest starts, but fails. The status bar shows: "Jest: Stopped"
  • The Jest output channel states:

Exception raised: Process failed: spawn node_modules\.bin\jest ENOENT
Finished running all tests. Starting watch mode.

Exception raised: Process failed: spawn node_modules\.bin\jest ENOENT

Exception raised: Process failed: spawn node_modules\.bin\jest ENOENT

Exception raised: Process failed: spawn node_modules\.bin\jest ENOENT

Exception raised: Process failed: spawn node_modules\.bin\jest ENOENT

Exception raised: Process failed: spawn node_modules\.bin\jest ENOENT
Starting Jest in Watch mode failed too many times and has been stopped. Please check your system configuration.
  • The Developer Tools console includes the same error:
  ERR spawn node_modules\.bin\jest ENOENT: Error: spawn node_modules\.bin\jest ENOENT
	at exports._errnoException (util.js:1050:11)
	at Process.__dirname.ChildProcess._handle.onexit (internal/child_process.js:193:32)
	at onErrorNT (internal/child_process.js:367:16)
	at _combinedTickCallback (internal/process/next_tick.js:80:11)
	at process._tickCallback (internal/process/next_tick.js:104:9)

Steps to Reproduce

Expected Behavior

  • The usual behavior
  • No error on the console

CC @stephtr

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions