Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows only - Jest testing files are included and try to run in the codebase #10420

Closed
timothyjoh opened this issue Dec 11, 2018 · 4 comments
Closed
Assignees
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.

Comments

@timothyjoh
Copy link

Description

I'm not having trouble running the tests per-se, but rather the test files show up in my browser when the code is all compiled together. I'm not specifically including them anywhere. This is giving me errors like "undefined function beforeEach, and function test"

Seems related to #7655 but maybe the opposite?

Steps to reproduce

Using the latest Gatsby: 2.0.63, babel core is at 7.2.0

Expected result

It should ignore the test.js files, as I am not directly including them

Actual result

I get an error page in the browser with ReferenceError: beforeEach is not defined
this also happens with test if i remove the beforeEach statements
The whole site runs normally if I comment out all the tests or delete the files.
This only happens on windows, I'm successful on the mac

Environment

System:
OS: Windows 10
CPU: (12) x64 AMD Ryzen 5 1600X Six-Core Processor
Binaries:
Yarn: 1.12.1 - C:\Users\Tim\AppData\Roaming\npm\yarn.CMD
npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 42.17134.1.0
npmPackages:
gatsby: ^2.0.52 => 2.0.63
gatsby-link: ^2.0.6 => 2.0.7
gatsby-plugin-no-sourcemaps: ^2.0.1 => 2.0.1
gatsby-plugin-react-helmet: ^3.0.1 => 3.0.4
gatsby-plugin-sass: ^2.0.3 => 2.0.7
gatsby-plugin-typescript: ^2.0.1 => 2.0.3
gatsby-remark-code-repls: ^2.0.1 => 2.0.2
gatsby-remark-component: ^1.1.3 => 1.1.3
gatsby-remark-embedded-codesandbox: ^1.2.0 => 1.2.0
gatsby-remark-prismjs: ^3.0.3 => 3.1.4
gatsby-source-filesystem: ^2.0.7 => 2.0.11
gatsby-transformer-json: ^2.1.5 => 2.1.6
gatsby-transformer-remark: ^2.1.11 => 2.1.15

@sidharthachatterjee sidharthachatterjee self-assigned this Dec 12, 2018
@sidharthachatterjee sidharthachatterjee added the status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. label Dec 12, 2018
@sidharthachatterjee
Copy link
Contributor

sidharthachatterjee commented Dec 12, 2018

Hey @jhnsntmthy

Could you please add a link to a minimal reproduction repo?

@gatsbot
Copy link

gatsbot bot commented Feb 7, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Feb 7, 2019
@gatsbot
Copy link

gatsbot bot commented Feb 18, 2019

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.

Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Gatsby community!

@gatsbot gatsbot bot closed this as completed Feb 18, 2019
@pakatagoh
Copy link

pakatagoh commented May 10, 2019

@sidharthachatterjee

@timothyjoh did you manage to solve the issue?

I'm getting the same issue here on windows. However, I do not own a mac machine so can't determine if this is a Windows issue.

I'm currently running windows 10

I've followed the tutorials from the docs. I'm currently only running 1 test on the 404 page just to play around.

this is the link to my github repo here
Cloning and npm install should get you up and running

i'm getting the following compilation error if that helps

i 「wdm」: Compiling...
 ERROR  Failed to compile with 1 errors              4:03:38 PM
This dependency was not found:

* fs in ./node_modules/css/lib/stringify/source-map-support.js

To install it, you can run: npm install --save fs
× 「wdm」:
ERROR in ./node_modules/css/lib/stringify/source-map-support.jsModule not found: Error: Can't resolve 'fs' in 'C:\Users\Pakata\Documents\gatsby\gatsby-site\node_modules\css\lib\stringify'
 @ ./node_modules/css/lib/stringify/source-map-support.js 10:9-22
 @ ./node_modules/css/lib/stringify/index.js
 @ ./node_modules/css/index.js
 @ ./node_modules/jest-dom/dist/utils.js
 @ ./node_modules/jest-dom/dist/to-be-in-the-dom.js
 @ ./node_modules/jest-dom/dist/index.js
 @ ./node_modules/jest-dom/dist/extend-expect.js
 @ ./node_modules/jest-dom/extend-expect.js
 @ ./src/pages/__tests__/404.test.js
 @ ./.cache/sync-requires.js
 @ ./.cache/app.js
 @ multi (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false C://Users//Pakata//Documents//gatsby//gatsby-site//.cache//app
i 「wdm」: Failed to compile.

I'll try my best to provide more info if required. I'm currently about to head out for a short vacation so i may not reply so often

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.
Projects
None yet
Development

No branches or pull requests

3 participants