Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

vscode jest not getting env=jsdom? #139

@Falieson

Description

@Falieson

Sorry this is kind of specific to my IDE (VSCode) but I hope many of you are using it too.
I really like the Jest VSC extension but I haven't gotten it to work w/ my ejected CRA-typescript app yet.
When I run the jest command from command line it works fine, but the IDE jest runner responds with:

 FAIL  src/routes/App.test.tsx
  ● renders without crashing

    ReferenceError: document is not defined
      
      at Object.<anonymous> (src/routes/App.test.tsx:6:15)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:42:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)


  ✕ renders without crashing (36ms)

I've tried changing my .vscode/settings.json in the project root folder to

{
   "jest.pathToJest": "node_modules/.bin/jest --env=jsdom"
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy