mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 10:52:35 +02:00
refactor: import jest as global; unify import style of some modules (#6898)
* refactor: import jest as global * fix react
This commit is contained in:
parent
e97dc0d37e
commit
c9ee6e467c
59 changed files with 177 additions and 139 deletions
|
@ -5,6 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import {jest} from '@jest/globals';
|
||||
import path from 'path';
|
||||
import remark from 'remark';
|
||||
import mdx from 'remark-mdx';
|
||||
|
|
|
@ -5,22 +5,20 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import {join} from 'path';
|
||||
import path from 'path';
|
||||
import remark from 'remark';
|
||||
import mdx from 'remark-mdx';
|
||||
import vfile from 'to-vfile';
|
||||
import plugin from '..';
|
||||
|
||||
const processFixture = async (name) => {
|
||||
const path = join(__dirname, '__fixtures__', name);
|
||||
const file = await vfile.read(path);
|
||||
const processFixture = async (name: string) => {
|
||||
const file = await vfile.read(path.join(__dirname, '__fixtures__', name));
|
||||
const result = await remark().use(mdx).use(plugin).process(file);
|
||||
return result.toString();
|
||||
};
|
||||
|
||||
const processFixtureAST = async (name) => {
|
||||
const path = join(__dirname, '__fixtures__', name);
|
||||
const file = await vfile.read(path);
|
||||
const processFixtureAST = async (name: string) => {
|
||||
const file = await vfile.read(path.join(__dirname, '__fixtures__', name));
|
||||
return remark().use(mdx).use(plugin).parse(file);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue