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

README of Unit Testing section refers to something that doesn't exist #9766

Closed
mjkrause opened this issue Nov 7, 2018 · 5 comments
Closed
Labels
good first issue Issue that doesn't require previous experience with Gatsby status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: documentation An issue or pull request for improving or updating Gatsby's documentation type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@mjkrause
Copy link

mjkrause commented Nov 7, 2018

Description

Check line Back to the Jest config, you can see the next option is testRegex. This is the pattern telling Jest which files contain tests. The pattern above matches any .js file inside a __tests__ directory,... in gatsby/docs/docs/unit-testing.md.
There is no variable named testRegex in the above example of jest.config.js. I have seen somewhere below in that file, though. In any case, that reference doesn't seem to be correct.

Steps to reproduce

see description

Expected result

Remove that reference, or put testRegex = ... into the example.

@kakadiadarpan
Copy link
Contributor

@mjkrause the best way of going through the Gatsby documentation would be through www.gatsbyjs.org, the links would not work as expected in the Github's README.md

For unit testing, please check the following link on gatsbyjs.org: https://www.gatsbyjs.org/docs/unit-testing/

@kakadiadarpan kakadiadarpan added the type: question or discussion Issue discussing or asking a question about Gatsby label Nov 7, 2018
@LekoArts
Copy link
Contributor

LekoArts commented Nov 7, 2018

No, you’re misunderstanding something here @kakadiadarpan
The text mentions a testRegex that was there before but @DSchau removed that from the config file with his last commit

@LekoArts LekoArts reopened this Nov 7, 2018
@kakadiadarpan
Copy link
Contributor

I can see the testRegex in the jest config file. Please check the attached screenshot below:

screenshot 2018-11-07 at 1 15 18 pm

@DSchau
Copy link
Contributor

DSchau commented Nov 7, 2018

Yeah, whoops! Easy fix to remove and re-arrange that paragraph. I did remove the option from jest.config.js because it wasn't necessary for JS files, but is still necessary for Typescript.

Someone want to tackle this? If not, one of us will get to it as soon as we can!

@DSchau DSchau added good first issue Issue that doesn't require previous experience with Gatsby type: documentation An issue or pull request for improving or updating Gatsby's documentation status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. labels Nov 7, 2018
RobinCsl added a commit that referenced this issue Nov 7, 2018
DSchau pushed a commit that referenced this issue Nov 7, 2018
Fixes issue #9766

<!--
  Q. Which branch should I use for my pull request?
  A. Use `master` branch (probably).

  Q. Which branch if my change is a bug fix for Gatsby v1?
  A. In this case, you should use the `v1` branch

  Q. Which branch if I'm still not sure?
  A. Use `master` branch. Ask in the PR if you're not sure and a Gatsby maintainer will be happy to help :)

  Note: We will only accept bug fixes for Gatsby v1. New features should be added to Gatsby v2.

  Learn more about contributing: https://www.gatsbyjs.org/docs/how-to-contribute/
-->
@RobinCsl
Copy link
Contributor

RobinCsl commented Nov 8, 2018

I believe this issue can be closed now, since my PR was merged.
cc @DSchau @LekoArts @shannonbux

@RobinCsl RobinCsl closed this as completed Nov 8, 2018
gpetrioli pushed a commit to gpetrioli/gatsby that referenced this issue Jan 22, 2019
Fixes issue gatsbyjs#9766

<!--
  Q. Which branch should I use for my pull request?
  A. Use `master` branch (probably).

  Q. Which branch if my change is a bug fix for Gatsby v1?
  A. In this case, you should use the `v1` branch

  Q. Which branch if I'm still not sure?
  A. Use `master` branch. Ask in the PR if you're not sure and a Gatsby maintainer will be happy to help :)

  Note: We will only accept bug fixes for Gatsby v1. New features should be added to Gatsby v2.

  Learn more about contributing: https://www.gatsbyjs.org/docs/how-to-contribute/
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue that doesn't require previous experience with Gatsby status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: documentation An issue or pull request for improving or updating Gatsby's documentation type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

5 participants