mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-22 05:27:00 +02:00
test: fix ALL type errors in tests (#7487)
This commit is contained in:
parent
e2e40b8f5f
commit
d50fe3b670
37 changed files with 407 additions and 184 deletions
|
@ -11,9 +11,15 @@ import {normalizePluginOptions} from '@docusaurus/utils-validation';
|
|||
import {posixPath, getFileCommitDate} from '@docusaurus/utils';
|
||||
import pluginContentBlog from '../index';
|
||||
import {validateOptions} from '../options';
|
||||
import type {DocusaurusConfig, LoadContext, I18n} from '@docusaurus/types';
|
||||
import type {
|
||||
DocusaurusConfig,
|
||||
LoadContext,
|
||||
I18n,
|
||||
Validate,
|
||||
} from '@docusaurus/types';
|
||||
import type {
|
||||
BlogPost,
|
||||
Options,
|
||||
PluginOptions,
|
||||
EditUrlFunction,
|
||||
} from '@docusaurus/plugin-content-blog';
|
||||
|
@ -77,7 +83,10 @@ const getPlugin = async (
|
|||
i18n,
|
||||
} as LoadContext,
|
||||
validateOptions({
|
||||
validate: normalizePluginOptions,
|
||||
validate: normalizePluginOptions as Validate<
|
||||
Options | undefined,
|
||||
PluginOptions
|
||||
>,
|
||||
options: {
|
||||
path: PluginPath,
|
||||
editUrl: BaseEditUrl,
|
||||
|
|
|
@ -7,10 +7,17 @@
|
|||
|
||||
import {normalizePluginOptions} from '@docusaurus/utils-validation';
|
||||
import {validateOptions, DEFAULT_OPTIONS} from '../options';
|
||||
import type {Options} from '@docusaurus/plugin-content-blog';
|
||||
import type {Options, PluginOptions} from '@docusaurus/plugin-content-blog';
|
||||
import type {Validate} from '@docusaurus/types';
|
||||
|
||||
function testValidate(options?: Options) {
|
||||
return validateOptions({validate: normalizePluginOptions, options});
|
||||
return validateOptions({
|
||||
validate: normalizePluginOptions as Validate<
|
||||
Options | undefined,
|
||||
PluginOptions
|
||||
>,
|
||||
options,
|
||||
});
|
||||
}
|
||||
|
||||
// The type of remark/rehype plugins can be either function, object or array
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue