Skip to content

console.log does not output when running tests #2441

Closed

Description

Do you want to request a feature or report a bug?

Report a bug.

What is the current behavior?

Calling console.log using the default testEnvironment of jsdom doesn't print to stdout.

If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can yarn install and yarn test.

  1. Clone https://github.com/udbhav/jest-test
  2. Run yarn test
  3. Confirm that you're not seeing anything from console.log
  4. Change the testEnvironment Jest configuration setting to node
  5. Re-run yarn test
  6. Confirm that you're seeing output from console.log

What is the expected behavior?

I would expect to have console.log always output while my tests are running.

Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.

See package.json and yarn.lock in the repo for package versions. I'm running node 7.3.0 and yarn 0.18.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions