-
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
test: adjust tests after the bump #33171
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
4d7a20c
just checking
pieh c9592c3
test failures
wardpeet 764f2fa
fix joi.subPlugins in gatsby-plugin-utils plugin options schema tester
pieh de26053
Revert "just checking"
pieh 0a9b10d
drop unused arg
pieh c231964
add missing dev dep
pieh 22e99b2
fix build-utils pages mock
pieh a018276
test(data-tracking): mock readFileSync
pieh a5ff40d
test(redux/index): mock readFileSync
pieh 008417e
test(babel-preset-gatsby-package): update snapshot
pieh 4c23cb7
Merge remote-tracking branch 'origin/master' into ci-test
pieh 61f9b64
test(redirects-writer): mock readFileSync
pieh e2ce80f
test(gen-mdx): set module on subplugin entry
pieh e253229
test(create-pages): add readFileSync mock
pieh 36a1f51
fix split tests
wardpeet 75d6601
test(requires-writer): set default mode on pages
pieh ac9289c
test(get-page-data): set default mode on pages
pieh d3c5a42
fix src/redux/__tests__/pages.ts
vladar f84f682
test(api): update snapshot
pieh d87eca2
test(remark/extend-node-type): add module fields to mocked subplugins…
pieh 5fbcf6a
fix circle
wardpeet File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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
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 |
---|---|---|
|
@@ -12,7 +12,35 @@ export async function testPluginOptionsSchema( | |
pluginSchemaFunction: Exclude<GatsbyNode["pluginOptionsSchema"], undefined>, | ||
pluginOptions: IPluginInfoOptions | ||
): Promise<ITestPluginOptionsSchemaReturnType> { | ||
const pluginSchema = pluginSchemaFunction({ Joi }) | ||
const pluginSchema = pluginSchemaFunction({ | ||
Joi: Joi.extend(joi => { | ||
return { | ||
base: joi.any(), | ||
type: `subPlugins`, | ||
args: (): any => | ||
joi | ||
.array() | ||
.items( | ||
joi | ||
.alternatives( | ||
joi.string(), | ||
joi.object({ | ||
resolve: Joi.string(), | ||
options: Joi.object({}).unknown(true), | ||
}) | ||
) | ||
.custom(value => { | ||
if (typeof value === `string`) { | ||
value = { resolve: value } | ||
} | ||
|
||
return value | ||
}, `Gatsby specific subplugin validation`) | ||
) | ||
.default([]), | ||
} | ||
}), | ||
}) | ||
Comment on lines
-15
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test helper wasn't aware of |
||
|
||
try { | ||
await validateOptionsSchema(pluginSchema, pluginOptions) | ||
|
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cross-env
used inprepare
script, but not declared in devDeps