mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 07:37:19 +02:00
test: fix some type errors in test files (#7486)
This commit is contained in:
parent
624735bd92
commit
e2e40b8f5f
50 changed files with 319 additions and 182 deletions
|
@ -21,7 +21,7 @@ function process(doc: string, plugins: Plugin[] = []) {
|
|||
return removePosition(processor.runSync(processor.parse(doc)), true);
|
||||
}
|
||||
|
||||
function heading(label: string, id: string) {
|
||||
function heading(label: string | null, id: string) {
|
||||
return u(
|
||||
'heading',
|
||||
{depth: 2, data: {id, hProperties: {id}}},
|
||||
|
|
|
@ -13,15 +13,15 @@ import plugin from '..';
|
|||
import transformImage, {type PluginOptions} from '../../transformImage';
|
||||
|
||||
const processFixture = async (name: string, options?: PluginOptions) => {
|
||||
const filePath = path.join(__dirname, `__fixtures__/${name}.md`);
|
||||
const siteDir = path.join(__dirname, `__fixtures__`);
|
||||
const staticDirs = [
|
||||
path.join(__dirname, '__fixtures__/static'),
|
||||
path.join(__dirname, '__fixtures__/static2'),
|
||||
path.join(siteDir, 'static'),
|
||||
path.join(siteDir, 'static2'),
|
||||
];
|
||||
const file = await vfile.read(filePath);
|
||||
const file = await vfile.read(path.join(siteDir, `${name}.md`));
|
||||
const result = await remark()
|
||||
.use(mdx)
|
||||
.use(transformImage, {...options, filePath, staticDirs})
|
||||
.use(transformImage, {...options, siteDir, staticDirs})
|
||||
.use(plugin, {
|
||||
...options,
|
||||
staticDirs,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue