-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(recipes): Fix shadow-file resource for scoped NPM packages & re-e…
…nable e2e testing for resources (#23274) * fix(recipes): Fix shadow-file resource for scoped NPM packages * WILL SLASH FIX WINDOWS??? * Add missing code block * Try again * hmmm joinPath maybe is the problem * More fixes * try reenabling tests * disable colors in diffs * Fix npm script test * Why do these keep changing all the time?? * Use parsed value for the plan * Disable Chalk colors on unit tests so match local ones * Update packages/gatsby-recipes/src/providers/utils/get-diff.js Co-Authored-By: John Otander <johnotander@gmail.com> Co-authored-by: John Otander <johnotander@gmail.com> Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
- Loading branch information
1 parent
d69b217
commit d8fdee6
Showing
13 changed files
with
1,102 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
225 changes: 225 additions & 0 deletions
225
packages/gatsby-recipes/src/providers/fs/__snapshots__/file.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,225 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`file resource e2e file resource test: File create 1`] = ` | ||
Object { | ||
"_message": "Wrote file file.txt", | ||
"content": "Hello, world!", | ||
"id": "file.txt", | ||
"path": "file.txt", | ||
} | ||
`; | ||
|
||
exports[`file resource e2e file resource test: File create plan 1`] = ` | ||
Object { | ||
"currentState": "", | ||
"describe": "Write file.txt", | ||
"diff": "- Original - 0 | ||
+ Modified + 1 | ||
+ Hello, world!", | ||
"newState": "Hello, world!", | ||
} | ||
`; | ||
|
||
exports[`file resource e2e file resource test: File destroy 1`] = ` | ||
Object { | ||
"_message": "Wrote file file.txt", | ||
"content": "Hello, world!1", | ||
"id": "file.txt", | ||
"path": "file.txt", | ||
} | ||
`; | ||
|
||
exports[`file resource e2e file resource test: File update 1`] = ` | ||
Object { | ||
"_message": "Wrote file file.txt", | ||
"content": "Hello, world!1", | ||
"id": "file.txt", | ||
"path": "file.txt", | ||
} | ||
`; | ||
|
||
exports[`file resource e2e file resource test: File update plan 1`] = ` | ||
Object { | ||
"currentState": "Hello, world!", | ||
"describe": "Write file.txt", | ||
"diff": "- Original - 1 | ||
+ Modified + 1 | ||
- Hello, world! | ||
+ Hello, world!1", | ||
"newState": "Hello, world!1", | ||
} | ||
`; | ||
|
||
exports[`file resource e2e remote file resource test: File create 1`] = ` | ||
Object { | ||
"_message": "Wrote file file.txt", | ||
"content": "query { | ||
allGatsbyPlugin { | ||
nodes { | ||
name | ||
options | ||
resolvedOptions | ||
package { | ||
version | ||
} | ||
... on GatsbyTheme { | ||
files { | ||
nodes { | ||
path | ||
} | ||
} | ||
shadowedFiles { | ||
nodes { | ||
path | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}", | ||
"id": "file.txt", | ||
"path": "file.txt", | ||
} | ||
`; | ||
|
||
exports[`file resource e2e remote file resource test: File create plan 1`] = ` | ||
Object { | ||
"currentState": "", | ||
"describe": "Write file.txt", | ||
"diff": "- Original - 0 | ||
+ Modified + 24 | ||
+ query { | ||
+ allGatsbyPlugin { | ||
+ nodes { | ||
+ name | ||
+ options | ||
+ resolvedOptions | ||
+ package { | ||
+ version | ||
+ } | ||
+ ... on GatsbyTheme { | ||
+ files { | ||
+ nodes { | ||
+ path | ||
+ } | ||
+ } | ||
+ shadowedFiles { | ||
+ nodes { | ||
+ path | ||
+ } | ||
+ } | ||
+ } | ||
+ } | ||
+ } | ||
+ }", | ||
"newState": "query { | ||
allGatsbyPlugin { | ||
nodes { | ||
name | ||
options | ||
resolvedOptions | ||
package { | ||
version | ||
} | ||
... on GatsbyTheme { | ||
files { | ||
nodes { | ||
path | ||
} | ||
} | ||
shadowedFiles { | ||
nodes { | ||
path | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}", | ||
} | ||
`; | ||
|
||
exports[`file resource e2e remote file resource test: File destroy 1`] = ` | ||
Object { | ||
"_message": "Wrote file file.txt", | ||
"content": "https://gist.githubusercontent.com/KyleAMathews/3d763491e5c4c6396e1a6a626b2793ce/raw/545120bfecbe7b0f97f6f021801bc8b6370b5b41/gistfile2.txt", | ||
"id": "file.txt", | ||
"path": "file.txt", | ||
} | ||
`; | ||
|
||
exports[`file resource e2e remote file resource test: File update 1`] = ` | ||
Object { | ||
"_message": "Wrote file file.txt", | ||
"content": "https://gist.githubusercontent.com/KyleAMathews/3d763491e5c4c6396e1a6a626b2793ce/raw/545120bfecbe7b0f97f6f021801bc8b6370b5b41/gistfile2.txt", | ||
"id": "file.txt", | ||
"path": "file.txt", | ||
} | ||
`; | ||
|
||
exports[`file resource e2e remote file resource test: File update plan 1`] = ` | ||
Object { | ||
"currentState": "query { | ||
allGatsbyPlugin { | ||
nodes { | ||
name | ||
options | ||
resolvedOptions | ||
package { | ||
version | ||
} | ||
... on GatsbyTheme { | ||
files { | ||
nodes { | ||
path | ||
} | ||
} | ||
shadowedFiles { | ||
nodes { | ||
path | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}", | ||
"describe": "Write file.txt", | ||
"diff": "- Original - 23 | ||
+ Modified + 3 | ||
- query { | ||
- allGatsbyPlugin { | ||
- nodes { | ||
- name | ||
- options | ||
- resolvedOptions | ||
- package { | ||
- version | ||
- } | ||
- ... on GatsbyTheme { | ||
- files { | ||
- nodes { | ||
- path | ||
- } | ||
- } | ||
- shadowedFiles { | ||
- nodes { | ||
- path | ||
- } | ||
- } | ||
- } | ||
- } | ||
- } | ||
+ const options = { | ||
+ key: process.env.WHATEVER | ||
+ | ||
}", | ||
"newState": "const options = { | ||
key: process.env.WHATEVER | ||
}", | ||
} | ||
`; |
Oops, something went wrong.