You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tests on Windows are broken due to two specific issues, which only affect a single package (gatsby-codemods). Both of these are technically upstream issues, rather than issues with Gatsby itself.
TL;DR we need to update @babel/core to at least 7.0.0-rc.3 (the hard part) and change one line in a single file.
Global GraphQL transforms (generated by gatsby-codemods/global-graphql-calls) output with the native system line-endings, rather than always using \n. This causes its jscodeshift tests to fail, since unlike Jest's built-in snapshot testing, jscodeshift's fixture tests don't normalise line endings.
To fix this, change the following line in gatsby-codemods/src/global-graphql-calls.js from:
...so that the generated files match the snapshots, which use \n endings, rather than \r\n on Windows. Alternatively, to fix the root cause of the issue, a PR could be sent to jscodeshift so that it normalises line endings when performing fixture tests.
Babel's --ignore **/__tests__ option is buggy on Windows with version 7.0.0-beta.52. Basically Babel converts globs to a regex, and then matches all files against this regex - internally this works a bit differently between Babel 7.0.0-beta.52 (which Gatsby is currently using) and 7.0.0-rc.3 (the latest version) - previously Babel used minimatch to do the conversion, but with the latest RC, it's been rewritten so that it does the conversion itself. So basically, to fix this issue we just need to update Babel to at least 7.0.0-rc.3.
Sidenote: the following line in .babel-preset.js needs to be changed to upgrade to Babel 7 rc3:
Various other problems occur but these are package-specific, whereas ALL builds will fail without this change.
The text was updated successfully, but these errors were encountered:
vtenfys
added
type: bug
An issue or pull request relating to a bug in Gatsby
help wanted
Issue with a clear description that the community can help with.
labels
Aug 26, 2018
cc @calcsam re: https://github.com/orgs/gatsbyjs/teams/maintainers/discussions/30/comments/7
Tests on Windows are broken due to two specific issues, which only affect a single package (gatsby-codemods). Both of these are technically upstream issues, rather than issues with Gatsby itself.
TL;DR we need to update @babel/core to at least 7.0.0-rc.3 (the hard part) and change one line in a single file.
Global GraphQL transforms (generated by
gatsby-codemods/global-graphql-calls
) output with the native system line-endings, rather than always using\n
. This causes its jscodeshift tests to fail, since unlike Jest's built-in snapshot testing, jscodeshift's fixture tests don't normalise line endings.To fix this, change the following line in
gatsby-codemods/src/global-graphql-calls.js
from:to:
...so that the generated files match the snapshots, which use
\n
endings, rather than\r\n
on Windows. Alternatively, to fix the root cause of the issue, a PR could be sent to jscodeshift so that it normalises line endings when performing fixture tests.Babel's
--ignore **/__tests__
option is buggy on Windows with version 7.0.0-beta.52. Basically Babel converts globs to a regex, and then matches all files against this regex - internally this works a bit differently between Babel 7.0.0-beta.52 (which Gatsby is currently using) and 7.0.0-rc.3 (the latest version) - previously Babel used minimatch to do the conversion, but with the latest RC, it's been rewritten so that it does the conversion itself. So basically, to fix this issue we just need to update Babel to at least 7.0.0-rc.3.Sidenote: the following line in
.babel-preset.js
needs to be changed to upgrade to Babel 7 rc3:Various other problems occur but these are package-specific, whereas ALL builds will fail without this change.
The text was updated successfully, but these errors were encountered: