-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Instantiating an instance of Link in unit tests triggers an error in withPrefix #24789
Labels
type: bug
An issue or pull request relating to a bug in Gatsby
Comments
planetcohen
added
the
type: bug
An issue or pull request relating to a bug in Gatsby
label
Jun 4, 2020
gatsbot
bot
added
the
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
label
Jun 4, 2020
Here is the PR with the fix: #24790 |
freiksenet
added
status: inkteam assigned
and removed
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
labels
Jun 5, 2020
As workaround, you can configure globals: {
__PATH_PREFIX__: ``,
__BASE_PATH__: ``, // add this line
}, see Unit testing docs for more info. |
davifantasia
added a commit
to commercetools/commercetools-docs-kit
that referenced
this issue
Jun 15, 2020
davifantasia
added a commit
to commercetools/commercetools-docs-kit
that referenced
this issue
Jun 15, 2020
* fix(deps): update all dependencies * chore: downgrade gatsby link because of this issue - gatsbyjs/gatsby#24789 Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Adewale Oluyinka <davifantasia@hotmail.com>
davifantasia
added a commit
to commercetools/commercetools-docs-kit
that referenced
this issue
Jun 25, 2020
davifantasia
added a commit
to commercetools/commercetools-docs-kit
that referenced
this issue
Jun 25, 2020
* chore(deps): update all dependencies * fix: tests breaks, see issue here - gatsbyjs/gatsby#24789 * fix: downgrade stylelint * fix: revert back to using latest gatsby link * fix: updated yarn lock Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Adewale Oluyinka <davifantasia@hotmail.com>
cbillowes
added a commit
to cbillowes/curious-programmer-nitrogen
that referenced
this issue
Oct 7, 2020
Breaks Chromatic integration gatsbyjs/gatsby#24789
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Running unit tests in my project (jest and react testing library) triggers a failure in the Link component in the withPrefix function.
The specific issue is the following line (which was recently changed):
If
__BASE_PATH__
is not defined, this triggers an error. The previous version of this file guarded against this case by checking thattypeof __BASE_PATH__
is defined.I will be submitting a PR shortly with a fix.
Steps to reproduce
Run a unit test using Jest with RTL for any component that uses the Gatsby Link component.
Expected result
No reference error.
Actual result
The specific error is:
Environment
The text was updated successfully, but these errors were encountered: